Add player money functions. Implement Merchant transaction functions. Add Function Priming classes.
This commit is contained in:
+7
-1
@@ -202,6 +202,10 @@ bool Crawler::OnUserCreate(){
|
||||
utils::datafile::INITIAL_SETUP_COMPLETE=true;
|
||||
|
||||
ValidateGameStatus(); //Checks to make sure everything has been initialized properly.
|
||||
|
||||
Merchant::RandomizeTravelingMerchant();
|
||||
Merchant&myMerchant=Merchant::GetCurrentTravelingMerchant();
|
||||
const std::vector<Item>&itemsAvailable=myMerchant.GetShopItems();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1725,6 +1729,7 @@ void Crawler::ChangePlayerClass(Class cl){
|
||||
Ability itemAbility1=player->useItem1;
|
||||
Ability itemAbility2=player->useItem2;
|
||||
Ability itemAbility3=player->useItem3;
|
||||
uint32_t oldMoney=player->money;
|
||||
switch(cl){
|
||||
case WARRIOR:{
|
||||
player.reset(NEW Warrior(player.get()));
|
||||
@@ -1750,6 +1755,7 @@ void Crawler::ChangePlayerClass(Class cl){
|
||||
player->SetBaseStat(ItemAttribute::attack,DATA.GetProperty(player->GetClassName()+".BaseAtk").GetInt());
|
||||
player->hpGrowthRate=float(DATA.GetProperty(player->GetClassName()+".HealthGrowthRate").GetReal());
|
||||
player->atkGrowthRate=float(DATA.GetProperty(player->GetClassName()+".AtkGrowthRate").GetReal());
|
||||
player->money=oldMoney;
|
||||
sig::Animation::SetupPlayerAnimations();
|
||||
GetPlayer()->UpdateIdleAnimation(DOWN);
|
||||
GetPlayer()->SetItem1UseFunc(itemAbility1);
|
||||
@@ -2239,7 +2245,7 @@ void Crawler::SetLoadoutItem(int slot,std::string itemName){
|
||||
bool Crawler::UseLoadoutItem(int slot){
|
||||
if(slot<0||slot>loadout.size()-1)ERR("Invalid inventory slot "+std::to_string(slot)+", please choose a slot in range (0-"+std::to_string(loadout.size()-1)+").");
|
||||
if(GetLoadoutItem(slot).Amt()>0){
|
||||
Inventory::UseItem(loadout[slot].Name());
|
||||
Inventory::UseItem(loadout[slot].ActualName());
|
||||
GetLoadoutItem(slot).OnUseAction();
|
||||
GetLoadoutItem(slot).amt--;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user