-소개-

말 그대로 최대 데미지 제한

적 캐릭터의 메모장을 이용해 설정가능

적 자체에 최대 데미지 제한을 거는거라 영역이랑 느낌이 쬐끔다름


-사용-

적 메모칸에

<DamageLimit:최대데미지> 라고 쓴다

여러줄 읽을 필요없을거라 판단(오판)해서 첫째줄에 안쓰면 적용 안될 수 있음


-하우 투 메이크-

1. 빈 스크립트 생성 후 아래의 코드를 작성

module DL

  WORD = "DamageLimit"

end

class RPG::BaseItem

  def forDL

    return @forDL if @forDL != nil

    memo = self.note.scan(/<#{DL::WORD}[::](\S+)>/).flatten

    @forDL = (memo != nil && !memo.empty?) ? memo[0].to_i : 0

    return @forDL

  end

end


class Game_ActionResult

  def limit_check(value)

    isDL = 0

    if @battler.kind_of?(Game_Enemy)

      isDL = $data_enemies[@battler.enemy_id].forDL

      if isDL != 0 && isDL < value

        value = isDL

      end

    end

    return value

  end

end


2. Game_ActionResult 스크립트의 make_damage 함수를 아래와 같이 수정

  def make_damage(value, item)

    @critical = false if value == 0

    value = limit_check(value) # 추가한 부분

    @hp_damage = value if item.damage.to_hp?

    @mp_damage = value if item.damage.to_mp?

    @mp_damage = [@battler.mp, @mp_damage].min

    @hp_drain = @hp_damage if item.damage.drain?

    @mp_drain = @mp_damage if item.damage.drain?

    @hp_drain = [@battler.hp, @hp_drain].min

    @success = true if item.damage.to_hp? || @mp_damage != 0

  end


3. 꼴리는 애들 메모칸에다 설정