//Gives the specified item with hold up animation and optional fanfare
//keep: Whether to actually give the item
//twoHand: Use 1 or 2 hand animation
//sfx: Whether to play item fanfare
void holdUpItem(int id, bool keep, bool twoHand, bool sfx)
{
if ( sfx )
Game->PlaySound(SFX_PICKUP);
if ( twoHand )
Link->Action = LA_HOLD2LAND;
else
Link->Action = LA_HOLD1LAND;
Link->HeldItem = id;
//Give the item and its counter effects
if(keep){
Link->Item[id] = true;
itemdata data = Game->LoadItemData(id);
//Increase capacity
if(data->MaxIncrement > 0 && data->Max > Game->MCounter[data->Counter]){
Game->MCounter[data->Counter] = Min(Game->MCounter[data->Counter]+data->MaxIncrement, data->Max);
}
//Increase count
if(data->Amount > 0)
Game->Counter[data->Counter] = Min(Game->Counter[data->Counter]+data->Amount, Game->MCounter[data->Counter]);
}
}
When giving Link an item that increases amount and uses the Drain Counter (Blue Rupee in this case), I don't get the correct counter increment. Giving a Blue Rupee through this appears to immediately max out Link's Rupee counter instead of gradually giving him 5 Rupees.
stdExtra.zh
Overview
Creator:
MoscowModder
Updated: 18 Mar 2015
Tags:
Library
Downloads: 242
|
View Script
Download Script (5.77 KB) |
Information
This library, stdExtra, is a collection of general-purpose constants, settings, and functions that can be used in a variety of different scripts.
Description Setup Reviews Comments
Orithan
Edited 23 July 2015 - 06:23 PM
I uncovered a bug with this function:
Mani Kanina
Edited 28 April 2015 - 06:08 PM
It would be nice if the required script files:
string.zh
ffcscript.zh
Were either added to the script database (and linked too from the description, for even easier access!) or included into the library itself. It should help streamline things. I'm currently searching the forums for the string one. *shrug*
edit: durrr, string is packed in with ZC.
ffcscript.zh
Were either added to the script database (and linked too from the description, for even easier access!) or included into the library itself. It should help streamline things. I'm currently searching the forums for the string one. *shrug*
edit: durrr, string is packed in with ZC.


