/// <summary> /// Similar to a revive, except for summons, it always restore the summon /// to full health and mana, purging status effects, and may be used while the summon /// is alive (hence not always needing to register the partyMember alive again) /// </summary> /// <param name="summon"></param> public void RestoreSummon(PartyMember summon) { if (summon.CheckDeath() == true) { RegisterPartyMemberAlive(summon); } summon.AddHP((int)(summon.HP)); summon.AddMP((int)(summon.MP)); summon.RemoveAllStatusEffects(); summon.GetSummonBuff(); }
/// <summary> /// Adds a loaded summon to the party /// </summary> /// <param name="summoner"> PartyMember summoning this </param> /// <param name="className"> Class of the summon (which is the unique ID) </param> /// <param name="ID"> Unique ID to be assigned to this summon </param> public void AddPartyMemberSummon(PartyMember summoner, string className, int ID) { GameObject clone = Instantiate(partyMember, new Vector3(0f, 0f, 0f), Quaternion.identity); PartyMember summon = clone.GetComponent <PartyMember>(); summon.gameObject.transform.SetParent(gameObject.transform, false); summon.ID = ID; summon.InitSummon(summons.Find(s => s.className == className), summoner); partyMembersAlive.Add(summon); partyMembersAll.Add(summon); EventManager.instance.UpdatePartyMembers(); summon.GetSummonBuff(); // have to add the buff AFTER the summon's pmvc is initted (so all visual components can be used) }