Dancer_A

Authority/Leadership

Mar 23rd, 2021 (edited)
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.50 KB | None | 0 0
  1.             // Leadership & Authority
  2.             WeaponType leadership = Global.weapon_types[11];
  3.             int authority = actor.get_weapon_level(leadership);
  4.             bool leader = false;
  5.             if (Global.scene.is_map_scene && !Global.game_map.is_off_map(Loc))
  6.                 foreach (int id in units_in_range(3))
  7.                 {
  8.                     Game_Unit unit = Global.game_map.units[id];
  9.                     int auraDistance = Global.game_map.unit_distance(Id, unit.id);
  10.                     if (unit.actor.get_weapon_level(leadership) >= 2) // D rank or higher
  11.                         leader = true;
  12.                     if (leader == true && !is_attackable_team(unit))
  13.                     {
  14.                         if (unit.actor.get_weapon_level(leadership) >= 5 || auraDistance < 3) // A rank or higher
  15.                         {
  16.                             n += (int)(2.5 * (unit.actor.get_weapon_level(leadership) - 1));
  17.                             break;
  18.                         }
  19.                     }
  20.                 }
  21.             if (authority >= 2) // D or higher
  22.             {
  23.  
  24.                 if (target != null)
  25.                 {
  26.                     int targ_auth = target.actor.get_weapon_level(leadership);
  27.                     if (authority > targ_auth)
  28.                         if (targ_auth == 0) // treat no rank the same as E rank
  29.                             targ_auth++;
  30.                     actor_hit += (authority - targ_auth) * 2;
  31.                 }
  32.             }
Advertisement
Add Comment
Please, Sign In to add comment