intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Oct 20, 2017 12:05 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Sep 29, 2017 1:00 pm 
Offline

Joined: Sat Sep 02, 2017 4:55 am
Posts: 3
Hi,

I'm setting up a fight system in my game. There is the potential for a lot fighting within the premise of the game, so, rather than having a set of passages for each potential fight sequence, I thought it would be better to have a single set of passages that could be accessed from anywhere in the game.
The set of passages will be;

Fight Init - where any fight-specific variables are set and calculations made.
Fight Screen - where the actual fighting will take place.
Spoils - where the user will collect gold, items, etc.
and a link to the Game Over passage.

The actual fighting-part works fine, and the links to the 'game-over' and 'spoils' passages work fine, and I believe i can use a combination of arrays and datamaps to allow me to change the variables going into the fight. But what i am struggling with is the spoils screen itself.

Each enemy will have a random amount of gold and possibly weapons, armour or items. These will be preset in a datamap within an array, e.g.

Code:
(set: $enemy01 to (datamap: "Name", 'A Slaver', "Gold", 10, "Strength", 4, "Item01", $item01, "Item02", 'n/a'))
(set: $enemy02 to (datamap: "Name", 'A Raider', "Gold", 20, "Strength", 5, "Item01", $item02, "Item02", 'n/a'))
(set: $enemy03 to (datamap: "Name", 'A Soldier', "Gold", 50, "Strength", 6, "Item01", $item01, "Item02", $weapon02))
(set: $enemies to (a: $enemy01, $enemy02, $enemy03))


The items and weapons will also be datamaps, e.g.

Code:
(set: $item01 to (datamap: "Name", 'Small Health Potion', "Ability", 'HP + 25', "Qty", 0, "Value", 25))
(set: $item02 to (datamap: "Name", 'Large Health Potion', "Ability", 'HP + 100', "Qty", 0, "Value", 100))
(set: $weapon01 to (datamap: "Damage", 3, "Value", 1, "Name", 'Rusty Dirk', "Qty", 0))


What i want the spoils screen to do is recognise that the enemy is carrying items and display the items with options to 'take'-(update the user inventory) or 'leave'. So, if enemy01 was defeated, the spoils screen would show that they were carrying $item01 and would have a link to allow the user to + 1 to the Item01 'Qty' in their inventory.

Any suggestions?


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group