Пример #1
0
 public void on_start()
 {
     //Simple, possibly need to refactor. Just need to check whether we should even
     //be bothering with the on_start method
     if (on_start_s != "")
     {
         /*
          * If we are aiming to reduce health, need to actually call the
          * take_damage method to interact with perks, trigger the die()
          * function
          */
         if (on_start_s == "Health" && on_start_m.op == operation.sub)
         {
             attack_data new_data = new attack_data();
             new_data.target     = target_character;
             new_data.attacker   = source_character;
             new_data.attack_ref = source_attack;
             target_character.take_damage(new_data, Mathf.Abs(on_start_m.argument));
         }
         else
         {
             Debug.Log("Called start of " + name);
             if (on_start_l == effect_length.permanent)
             {
                 int cur_value = target_character.stats.get_stat_value(on_start_s);
                 target_character.stats.set_stat(on_start_s, on_start_m.mod_value(cur_value));
             }
             else if (on_start_l == effect_length.temporary)
             {
                 target_character.stats.add_modifier(on_start_m, on_start_s);
             }
         }
         turns_remaining = max_turns;
         if (on_start_e != null)
         {
             GameObject new_effect = GameObject.Instantiate(on_start_e);
             new_effect.transform.position = target_character.transform.position;
         }
     }
 }