Dancer_A

Chivalry (Old)

Jan 17th, 2022
1,414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.80 KB | None | 0 0
  1. // Game_Unit_Skill.CS
  2.         #region Start Attack Bools
  3.         bool Chivalry = false;
  4.         #endregion
  5.  
  6.         private void start_attack_skills(int attackIndex, Game_Unit target)
  7.         {
  8.             if (attackIndex == -1)
  9.             {
  10.             // Chivalry
  11.                 if (target != null && target is Game_Unit)
  12.                     if (actor.has_skill("CHIV") && !nihil(target))
  13.                         if (target.actor.hp >= (target.actor.maxhp / 2))
  14.                             Chivalry = true;
  15.             }
  16.         }
  17.  
  18.         private void end_battle_skills()
  19.         {
  20.             // Overwritten by Vendetta and Swoop //Yeti
  21.             // Skills: Swoop
  22.             Swoop_Activated = false;
  23.             Swoop_Attacked = false;
  24.             // Skills: Trample
  25.             Trample_Activated = false;
  26.             Chivalry = false; // <<--
  27.         }
  28.  
  29.         internal void dmg_skill(
  30.             ref int skill_dmg, ref int weapon_dmg, ref int actor_dmg, ref int support_dmg,
  31.             ref int target_def, Data_Weapon weapon,
  32.             Game_Unit target, Data_Weapon target_weapon, WeaponTriangle tri, bool magic,
  33.             int? distance, float effectiveness = 1)
  34.         {
  35.             // Skills: Chivalry
  36.             if (chivalry_active(target) || Chivalry)
  37.                     skill_dmg += 3;
  38.             // Skills: Chivalry
  39.             if (target != null && target is Game_Unit)
  40.                 if (chivalry_active(this) || target.Chivalry)
  41.                     skill_dmg -= 3;
  42.         }
  43.  
  44.  
  45.  
  46.  
  47.         public bool chivalry_active (Game_Unit target)
  48.         {
  49.             if (target != null)
  50.                 if (actor.has_skill("CHIV") && !nihil(target))
  51.                     if (target.actor.hp >= target.actor.maxhp / 2)
  52.                         return true;
  53.             return false;
  54.         }
  55.  
  56.  
Advertisement
Add Comment
Please, Sign In to add comment