DropItem¶
This method will make an enemy party member drop its helditem and reset holditem accordingly. Check the feature documentation to learn more.
private void DropItem(ref MainManager.BattleData target, bool additem)
Parameters¶
target: The enemy party member to have itshelditemdropped. NOTE: it is invalid to send a player party memberadditem: Whether or not theholditemshould be added toitems[0](standard items inventory) before its drop
Procedure¶
- The
Fallsound is played - If additem is true, the enemy party member has a
holditemand the amount ofitems[0](standard items) is less than instance.maxitems, theholditemis added toitems[0] - The enemy party member's
holditemis set to -1 - ItemDrop is called with the enemy party member's
helditemwhich does the following:- Root
helditemto the scene - Add a RigidBody to
helditemwith a velocity of RandomItemBounce(5.0, 12.5) helditemgets destroyed in 1.0 second
- Root
helditemis set to null