#============================================================================== # Hunger & Thirst - Cannibalism Patch # Version 1.02 # Author : LiTTleDRAgo #============================================================================== #------------------------------------------------------------------------------ # ** Notetags for Enemies #------------------------------------------------------------------------------ # For VX and VXA user can use notetags at Enemy Tabs to determine # food / drink recovery rates # (notetags configuration will be prioritized): # # # # # # # fixed value only # # fixed value only # #============================================================================== module LiTTleDRAgo #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=: # BEGIN CONFIGURATION #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=: CANNIBALISM_RECOVER_HUNGER_THIRST = { # Cannibalism recover hunger / thirst # Set up your enemy recovery rates here. Recovery can be by either absolute # value, or by percent. Setting :percent to true will make it by percent. :id => [:hunger, :thirst, :percent], 1 => [ -5, 5, false], # For lazy user who wants to set every unconfigured enemy. 0 => [ 10, -3, true], } #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=: # END CONFIGURATION #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=: #---------------------------------------------------------------------------- # Don't edit CANNIBALISM_HUNGER_THIRST_TAGS = { :hunger => //i, :thirst => //i, :incmaxhunger => //i, :incmaxthirst => //i, :hungerpercent => //i, :thirstpercent => //i, } #---------------------------------------------------------------------------- end ($imported||={})[:drg_hunger_thirst_cannibalism_patch] = 1.02 hunger_thirst = "This script needs Drago - Hunger & Thirst ver 1.05 or above" cannibalism = "This script needs Drago - Cannibalism ver 1.05 or above" ($imported[:drg_hunger_thirst] || 0) >= 1.05 || raise(hunger_thirst) ($imported[:drg_cannibalism_xp] || 0) >= 1.05 || raise(cannibalism) #============================================================================== # ** Game_Battler #------------------------------------------------------------------------------ # This class deals with battlers. It's used as a superclass for the Game_Actor # and Game_Enemy classes. #============================================================================== Klass = LiTTleDRAgo::VXA ? Scene_Battle : Game_Battler class Klass #-------------------------------------------------------------------------- # ● Public Instance Variables #-------------------------------------------------------------------------- attr_sec_reader :ca_hunger_tags,'LiTTleDRAgo::CANNIBALISM_HUNGER_THIRST_TAGS' #-------------------------------------------------------------------------- # ● Alias Listing #-------------------------------------------------------------------------- alias_sec_method :devour_hunger_thirst, :devour #-------------------------------------------------------------------------- # ● Aliased method: devour #-------------------------------------------------------------------------- def devour(user, item) irg = [user,item] target, user = self, user target, user = user, @subject if LiTTleDRAgo::VXA if item.is_a?(RPG::Skill) && devour_skill?(item)&& user.is_a?(Game_Actor)&& target.is_a?(Game_Enemy) && target.can_devour? && target.dead? && (user.devoured[target.enemy_id] || 0) < target.devour_limit rec = LiTTleDRAgo::CANNIBALISM_RECOVER_HUNGER_THIRST[target.enemy_id] rec ||= LiTTleDRAgo::CANNIBALISM_RECOVER_HUNGER_THIRST[0] || [] rec[0] = $1.to_i if target.get_note =~ ca_hunger_tags[:hunger] rec[1] = $1.to_i if target.get_note =~ ca_hunger_tags[:thirst] user.max_hunger += $1.to_i if target.get_note =~ ca_hunger_tags[:incmaxhunger] user.max_thirst += $1.to_i if target.get_note =~ ca_hunger_tags[:incmaxthirst] if rec.at(0).is_a?(Numeric) && rec.at(0) != 0 a = rec.at(2)==true||target.get_note =~ ca_hunger_tags[:hungerpercent] rec[0] = (user.max_hunger*(rec.at(0)*0.01)).ceil if a user.hunger += rec.at(0) $game_party.check_hunger_states end if rec.at(1).is_a?(Numeric) && rec.at(1) != 0 a = rec.at(2)==true||target.get_note =~ ca_hunger_tags[:thirstpercent] rec[1] = (user.max_thirst*(rec.at(1)*0.01)).ceil if a user.thirst += rec.at(1) $game_party.check_thirst_states end end devour_hunger_thirst(*irg) end end