Beispiel #1
0
        public override void OnChatButtonClicked(bool firstButton, ref bool shop)
        {
            if (firstButton)
            {
                Main.NewText("OK, I'll take your Pokémon for a few seconds.");
                Main.NewText("...");
                Main.NewText("Thank you for waiting.");
                Main.NewText("We've restored your Pokémon to full health.");
                Main.NewText("We hope to see you again!");

                for (int i = 0; i < Main.player[Main.myPlayer].inventory.Length; i++)
                {
                    PokemonWeapon pokemonWeapon = Main.player[Main.myPlayer].inventory[i].modItem as PokemonWeapon;
                    if (pokemonWeapon != null)
                    {
                        pokemonWeapon.currentHP = pokemonWeapon.maxHP;
                        pokemonWeapon.SetToolTip();
                        if (pokemonWeapon.npc != null)
                        {
                            pokemonWeapon.npc.life = pokemonWeapon.maxHP;
                            pokemonWeapon.npc.HealEffect(pokemonWeapon.maxHP);
                        }
                    }
                }
            }
        }
Beispiel #2
0
 public override void Kill(double damage, int hitDirection, bool pvp, string deathText)
 {
     for (int i = 0; i < player.inventory.Length; i++)
     {
         PokemonWeapon pokemonWeapon = player.inventory[i].modItem as PokemonWeapon;
         if (pokemonWeapon != null)
         {
             pokemonWeapon.currentHP = pokemonWeapon.maxHP;
             pokemonWeapon.SetToolTip();
             if (pokemonWeapon.npc != null)
             {
                 pokemonWeapon.npc.life = pokemonWeapon.maxHP;
                 pokemonWeapon.npc.HealEffect(pokemonWeapon.maxHP);
             }
         }
     }
 }
Beispiel #3
0
 public override bool UseItem(Player player)
 {
     for (int i = 0; i < Main.player[player.whoAmI].inventory.Length; i++)
     {
         PokemonWeapon pokemonWeapon = Main.player[player.whoAmI].inventory[i].modItem as PokemonWeapon;
         if (pokemonWeapon != null)
         {
             if (pokemonWeapon.npc != null)
             {
                 pokemonWeapon.npc.HealEffect(pokemonWeapon.maxHP - pokemonWeapon.npc.life);
                 pokemonWeapon.npc.life  = pokemonWeapon.maxHP;
                 pokemonWeapon.currentHP = pokemonWeapon.npc.life;
                 pokemonWeapon.SetToolTip();
                 return(true);
             }
         }
     }
     return(false);
 }