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 itshelditem
dropped. NOTE: it is invalid to send a player party memberadditem
: Whether or not theholditem
should be added toitems[0]
(standard items inventory) before its drop
Procedure¶
- The
Fall
sound is played - If additem is true, the enemy party member has a
holditem
and the amount ofitems[0]
(standard items) is less than instance.maxitems
, theholditem
is added toitems[0]
- The enemy party member's
holditem
is set to -1 - ItemDrop is called with the enemy party member's
helditem
which does the following:- Root
helditem
to the scene - Add a RigidBody to
helditem
with a velocity of RandomItemBounce(5.0, 12.5) helditem
gets destroyed in 1.0 second
- Root
helditem
is set to null