자유게시판

#==============================================================================
# ● 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)

    Date2012.07.17 Category공지 By완폐남™ Views41182
    read more
  2. 액터부분 윈도스킨없애고 ... 골드 표시 좀 위로올림

    Date2009.11.02 By라이네크 Views935
    Read More
  3. 질문~!!!

    Date2009.11.02 By코르뉴 Views772
    Read More
  4. 요롷코롬 바꿔주세요

    Date2009.11.02 ByLast H Views724
    Read More
  5. 온라인 개발방향 변경 =ㅅ=

    Date2009.11.02 Category잡담 By효과음 Views1318
    Read More
  6. 중화 5천년의 신비 : 최신판

    Date2009.11.02 Category잡담 ByEvangelista Views1041
    Read More
  7. 키보드 워리어즈

    Date2009.11.02 Category잡담 ByEvangelista Views825
    Read More
  8. 이탈리아군의 명성은 익히들어 알고있으나

    Date2009.11.02 Category잡담 ByEvangelista Views999
    Read More
  9. 타이틀 완성햇습니다 .ㅅ.

    Date2009.11.02 By라이네크 Views964
    Read More
  10. 아파치세팅완료 기념

    Date2009.11.01 Category잡담 By이프 Views893
    Read More
  11. Date2009.11.01 Category잡담 By코르뉴 Views744
    Read More
  12. 럭 시스템 완성!!!!

    Date2009.11.01 Category잡담 By코르뉴 Views804
    Read More
  13. 오류가 나는 부분입니다 , 몹 드랍, luck.

    Date2009.11.01 Category잡담 By코르뉴 Views775
    Read More
  14. 코르뉴님 module RPG 관련 일부입니다.

    Date2009.11.01 Category잡담 ByEvangelista Views1024
    Read More
  15. LUK 부분 조금.. 짤렷는데 이거 어찌해야하지 ㅋㅋ

    Date2009.11.01 By라이네크 Views812
    Read More
  16. 서버 ON-OFF 그림으로표시해주기

    Date2009.11.01 By小子非 Views1688
    Read More
  17. [rpg] 더 마나월드

    Date2009.11.01 By小子非 Views1868
    Read More
  18. 또 오랜만임

    Date2009.11.01 Category잡담 ByCiTY Views810
    Read More
  19. 마 비 노 기

    Date2009.11.01 Category잡담 By코르뉴 Views1213
    Read More
  20. 마비노기 같이 하실분~ ㅋ

    Date2009.11.01 Category잡담 By완폐남™ Views974
    Read More
  21. 엄마 몰라 얘네 무서워

    Date2009.11.01 Category잡담 By이프 Views1007
    Read More
목록
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