Infinite, battle tower kind of game. I managed to finish most vital aspects such as stats you can increase in a style similar to Dark Souls and a combat system with not only skills, but also evasion and critical. Now, I'm trying to finally build a Shop where player can buy equipment that they can equip to enhance their stats even further. It's kind of hard to explain so I'll just leave a part of the code here and explain as I go.
This is the Inventory screen
<<if $basic_iron_sword is true>>Iron Sword(+5 Attack) <---It is automatically obtained and automatically equipped when game first start.
A cheap and dull iron sword you bought at a sale.<</if>>
<<if $equiped_basic_iron_sword is true>>You're already wielding this weapon.<<else>>[[Equip|Equip basic_iron_sword]]<</if>>
<<if $golden_sword is true>>Golden Sword(+7 Attack, +3 Magic Effectiveness)<----Bought from shop
A golden sword you bought from the ghost merchant. He assured you that the thing is tougher than it looks.<</if>>
<<if $equiped_golden_sword is true>>You're already wielding this weapon.<<else>>[[Equip|Equip golden_sword]]<</if>>
[[Back to game|Base]]<----This button returns the player back to their base, the HUB basically. So no infinite <<return>> loop.
Now say, I want to equip the golden sword. So, I click on Equip which takes me to this passage, "Equip golden_sword"
<<set $playerattack += 7>><<set $playermagicattack += 3>><<set $equiped_golden_sword to true>><<goto "Player Bag">><----This will equip the thing. Set all that stats and then immediately return player back to inventory.
With that example written, my question is. How do I get the Basic Iron Sword to auto-unequip when I switch to another item? I mean, I can obviously do
<<set $playerattack += 7>><<set $playermagicattack += 3>><<set $equiped_golden_sword to true>><<set $equiped_basic_iron_sword to false>><<if $equiped_basic_iron_sword is false>><<set $playerattack -= 5>><</if>><<goto "Player Bag">>
But if I use this method, then it will get out of control real quick if I were to have like 20+ swords. Does anyone know a more, reasonable effective way to accomplish this goal?
This is the Inventory screen
<<if $basic_iron_sword is true>>Iron Sword(+5 Attack) <---It is automatically obtained and automatically equipped when game first start.
A cheap and dull iron sword you bought at a sale.<</if>>
<<if $equiped_basic_iron_sword is true>>You're already wielding this weapon.<<else>>[[Equip|Equip basic_iron_sword]]<</if>>
<<if $golden_sword is true>>Golden Sword(+7 Attack, +3 Magic Effectiveness)<----Bought from shop
A golden sword you bought from the ghost merchant. He assured you that the thing is tougher than it looks.<</if>>
<<if $equiped_golden_sword is true>>You're already wielding this weapon.<<else>>[[Equip|Equip golden_sword]]<</if>>
[[Back to game|Base]]<----This button returns the player back to their base, the HUB basically. So no infinite <<return>> loop.
Now say, I want to equip the golden sword. So, I click on Equip which takes me to this passage, "Equip golden_sword"
<<set $playerattack += 7>><<set $playermagicattack += 3>><<set $equiped_golden_sword to true>><<goto "Player Bag">><----This will equip the thing. Set all that stats and then immediately return player back to inventory.
With that example written, my question is. How do I get the Basic Iron Sword to auto-unequip when I switch to another item? I mean, I can obviously do
<<set $playerattack += 7>><<set $playermagicattack += 3>><<set $equiped_golden_sword to true>><<set $equiped_basic_iron_sword to false>><<if $equiped_basic_iron_sword is false>><<set $playerattack -= 5>><</if>><<goto "Player Bag">>
But if I use this method, then it will get out of control real quick if I were to have like 20+ swords. Does anyone know a more, reasonable effective way to accomplish this goal?