자유게시판

#==============================================================================
# ● RPG::Armor
#==============================================================================

class Armor
  #--------------------------------------------------------------------------
  # ● MaxHP 변화량을 메모로부터 취득한다. ex) maxhp(n)
  #--------------------------------------------------------------------------
  def maxhp
    text = @note[/maxhp(-*d+)/]
    return 0 if text == nil
    result = text[/d+/].to_i
    return (text.include?("-") ? -result : result)
  end
  #--------------------------------------------------------------------------
  # ● MaxTP 변화량을 메모로부터 취득한다. ex) maxmp(n)
  #--------------------------------------------------------------------------
  def maxmp
    text = @note[/maxmp(-*d+)/]
    return 0 if text == nil
    result = text[/d+/].to_i
    return (text.include?("-") ? -result : result)
  end
  #--------------------------------------------------------------------------
  # ● PDP 추가치를 메모로부터 취득한다. ex) pdp(n)
  #--------------------------------------------------------------------------
  def pdp
    text = @note[/pdp(-*d+)/]
    return 0 if text == nil
    result = text[/d+/].to_i
    return (text.include?("-") ? -result : result)
  end
  #--------------------------------------------------------------------------
  # ● MDP 추가치를 메모로부터 취득한다. ex) mdp(n)
  #--------------------------------------------------------------------------
  def mdp
    text = @note[/mdp(-*d+)/]
    return 0 if text == nil
    result = text[/d+/].to_i
    return (text.include?("-") ? -result : result)
  end
  #--------------------------------------------------------------------------
  # ● WP 추가치를 메모로부터 취득한다. ex) wp(n)
  #--------------------------------------------------------------------------
  def wp
    text = @note[/wp(-*d+)/]
    return 0 if text == nil
    result = text[/d+/].to_i
    return (text.include?("-") ? -result : result)
  end
  #--------------------------------------------------------------------------
  # ● PEV 추가치를 메모로부터 취득한다. ex) pev(n)
  #--------------------------------------------------------------------------
  def pev
    text = @note[/pev(-*d+)/]
    return 0 if text == nil
    result = text[/d+/].to_i
    return (text.include?("-") ? -result : result)
  end
  #--------------------------------------------------------------------------
  # ● MEV 추가치를 메모로부터 취득한다. ex) mev(n)
  #--------------------------------------------------------------------------
  def mev
    text = @note[/mev(-*d+)/]
    return 0 if text == nil
    result = text[/d+/].to_i
    return (text.include?("-") ? -result : result)
  end
end

 

이렇게 하면 뭐가 되냐면

방어구(class Armor)의 메모(@note)를 검색해서 가령 mev(3)이란 문자열이 있을 때

mev는 검색판별로 사용하고 실질값 3을 구해서 armor.mev등으로 추가하는거죠.

즉 그경우 armor(game_actor에선 armor_id를 @item으로 넣어버리므로 @item.mev).mev는 3이 됩니다.


  1. 아방스 게시물 · 댓글 작성 규칙 (최근 수정일 2015.11.25)

  2. 수능이 얼마 남지 않았군요.

  3. 처참하군요...

  4. 작년에 갔었던 일본 사진들..

  5. 팬시의 스킬들

  6. 채색 잘하시는분..

  7. No Image 02Nov
    by 라이네크
    2009/11/02 by 라이네크
    Views 935 

    액터부분 윈도스킨없애고 ... 골드 표시 좀 위로올림

  8. 질문~!!!

  9. No Image 02Nov
    by Last H
    2009/11/02 by Last H
    Views 724 

    요롷코롬 바꿔주세요

  10. 온라인 개발방향 변경 =ㅅ=

  11. 중화 5천년의 신비 : 최신판

  12. 키보드 워리어즈

  13. 이탈리아군의 명성은 익히들어 알고있으나

  14. 타이틀 완성햇습니다 .ㅅ.

  15. 아파치세팅완료 기념

  16. 럭 시스템 완성!!!!

  17. 오류가 나는 부분입니다 , 몹 드랍, luck.

  18. 코르뉴님 module RPG 관련 일부입니다.

  19. LUK 부분 조금.. 짤렷는데 이거 어찌해야하지 ㅋㅋ

  20. No Image 01Nov
    by 小子非
    2009/11/01 by 小子非
    Views 1688 

    서버 ON-OFF 그림으로표시해주기

목록
Board Pagination Prev 1 ... 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 ... 755 Next
/ 755