コード例 #1
0
ファイル: Creature.cs プロジェクト: grsu-PY/ITGame
 protected virtual void ApplySurfaceRule(SurfaceRule surfaceRule, bool bonus, double bonusRate = 1)
 {
     if (bonus)
     {
         Wisdom += (int)(surfaceRule.Wisdom * bonusRate);
         Strength += (int)(surfaceRule.Strength * bonusRate);
         Agility += (int)(surfaceRule.Agility * bonusRate);
         HP += (int)(surfaceRule.HP * bonusRate);
         MP += (int)(surfaceRule.MP * bonusRate);
     }
     else
     {
         Wisdom -= (int)(surfaceRule.Wisdom * bonusRate);
         Strength -= (int)(surfaceRule.Strength * bonusRate);
         Agility -= (int)(surfaceRule.Agility * bonusRate);
         HP -= (int)(surfaceRule.HP * bonusRate);
         MP -= (int)(surfaceRule.MP * bonusRate);
     }
 }
コード例 #2
0
 public SurfaceAffectEventArgs(SurfaceType surfaceType, SurfaceRule actionRule)
 {
     this.actionRule = actionRule;
     this.surfaceType = surfaceType;
 }