mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-13 22:04:36 +01:00
Implement buying goods with jades
This commit is contained in:
@@ -273,6 +273,9 @@ public class Inventory extends BasePlayerManager {
|
|||||||
if (param.getId() == GameConstants.MATERIAL_COIN_ID) {
|
if (param.getId() == GameConstants.MATERIAL_COIN_ID) {
|
||||||
// Remove credits
|
// Remove credits
|
||||||
getPlayer().addSCoin(-param.getCount() * multiplier);
|
getPlayer().addSCoin(-param.getCount() * multiplier);
|
||||||
|
} else if (param.getId() == GameConstants.MATERIAL_HCOIN_ID) {
|
||||||
|
// Remove credits
|
||||||
|
getPlayer().addHCoin(-param.getCount() * multiplier);
|
||||||
} else if (param.getId() == GameConstants.ROGUE_TALENT_POINT_ITEM_ID) {
|
} else if (param.getId() == GameConstants.ROGUE_TALENT_POINT_ITEM_ID) {
|
||||||
// Remove credits
|
// Remove credits
|
||||||
getPlayer().addTalentPoints(-param.getCount() * multiplier);
|
getPlayer().addTalentPoints(-param.getCount() * multiplier);
|
||||||
@@ -394,6 +397,11 @@ public class Inventory extends BasePlayerManager {
|
|||||||
if (!verifyScoin(param.getCount() * multiplier)) {
|
if (!verifyScoin(param.getCount() * multiplier)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else if (param.getId() == GameConstants.MATERIAL_HCOIN_ID) {
|
||||||
|
// Check jades
|
||||||
|
if (!verifyHcoin(param.getCount() * multiplier)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else if (param.getId() == GameConstants.ROGUE_TALENT_POINT_ITEM_ID) {
|
} else if (param.getId() == GameConstants.ROGUE_TALENT_POINT_ITEM_ID) {
|
||||||
return this.getPlayer().getTalentPoints() >= param.getCount() * multiplier;
|
return this.getPlayer().getTalentPoints() >= param.getCount() * multiplier;
|
||||||
} else {
|
} else {
|
||||||
@@ -411,6 +419,10 @@ public class Inventory extends BasePlayerManager {
|
|||||||
public boolean verifyScoin(int cost) {
|
public boolean verifyScoin(int cost) {
|
||||||
return this.getPlayer().getScoin() >= cost;
|
return this.getPlayer().getScoin() >= cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean verifyHcoin(int cost) {
|
||||||
|
return this.getPlayer().getHcoin() >= cost;
|
||||||
|
}
|
||||||
|
|
||||||
// Equips
|
// Equips
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user