Suggestions for combat

clockworkdragon
Hello again!

Today I have some questions about adding combat to your game. I am still, off and on, slowly plugging away at making a text adventure game and I was wondering if any out there would be kind enough to share advice on adding a combat system to their games or maybe letting me know if my idea is too complicated or too simplistic.

Before I get into the meat and potatoes of this question, there are a few details that I should mention about the game.

The story follows the adventures of your character from youth to old age. The choices the player makes will effect not only the plot but their over all health as well. Like combat. If a player survives a battle but suffers a grievous injury it will decrease his chances for surviving to old age.

I would also like the action to have more narrative beyond 'Hero slashes monster. Monster falls over and dies'. I don't plan for hte action scenes to be very long and to have a more story book feel to them.

And yes, I am considering making this a story book with stats instead of a game.

I have yet to code any of this yet but here is the idea I keep going back to for any game I try to make.


When the Enemy attacks the Hero he will roll a 20 sided die. If he rolls lower than the players agility he misses, if he rolls higher he lands a hit on the player. The players Agility starts at 12 and goes up or down depending on the players choices. For example, if the player is wearing heavy armor, or wounded, or gains weight etc etc his agility will go down, making him easier to hit.

If the player is hit he will then roll his defense. Each number in the players defense represents 1 six-sided die. If he rolls higher than the damage the enemy can deal then the attack get's blocked by the players armor. If not then he loses the difference in HP between his defensive roll and the amount of damage the enemy can deal out.

The players normal defense is 1 or 2 and raises depending on the armor he is wearing at the time.

Does that make sense? OR did I just horribly over complicate this when an easier solution was to be had XD

How do others usually add combat to their games?

Silver
Have you looked at any of the libraries such as this one:

viewtopic.php?f=18&t=4886

There's also a D&D style dice library kicking about somewhere.

The Pixie
You definitely need to look at the tread Silver linked to, if only to see how complicated this is going to be - but it is certainly doable. It uses a similar system to determine whether an attacker has hit, but damage is calculated differently. If you can work out what the code is doing, you should be able to modify it relatively easily - or you might decide to keep it as it is.

Also look at this thread, which is about making a text adventure look like a game book. Game books are too limited for what you want to do.
viewtopic.php?f=18&t=4772

clockworkdragon
Thank you all again for the quick response. I'll Try out your suggestions.

HegemonKhan
Pixie's Simple Combat Library is very good and easy to understand. Though it's design is a more open ~ 'free-flowing ~ active' combat system.

So, if you want a more locked ~ turn-based combat sytem, then... take a look at mine (used Pertex's code structure) + Pertex' Combat System, below:

though, if you just want to at least see another type of combat system for merely ideas, you can take a look at my adaptation of Pertex' Combat Library too:

(though do be warned, this is an old version, it's very ugly and poorly done along with an annoying use of abrevs which I've learned never to do ever again as even I was having trouble with remembering my own abrevs meanings lol, I've improved a bit since I did this successfully, but I don't have any sources of an updated better version of my combat code... I might have some posts on here... but trying to find them... riiiight... lol)

(so, if you're interested in this design of code, mine+Pertex: turn-based script-block-locked combat, then let me know, and I can probably re-code it for you in a much better version, if you'd like)

viewtopic.php?t=3348 (see the last ~ most recent posts to find my combat code posts)

here's Pertex' CLEANING UP ~ REFINING of my code (so you should look at this link instead of my poor initial code further below): viewtopic.php?f=10&t=3348&start=120#p22485

here: viewtopic.php?f=10&t=3348&start=120#p22483 (seen also directly below in the code box)

<asl version="530">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<pov type="object">player</pov>
<start type="script">
cc
</start>
<turns type="int">0</turns>
<statusattributes type="stringdictionary">turns = </statusattributes>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="defaultplayer" />
<inherit name="pc" />
<cur_hp type="int">999</cur_hp>
<max_hp type="int">999</max_hp>
<str type="int">100</str>
<end type="int">100</end>
<dex type="int">100</dex>
<agi type="int">100</agi>
<spd type="int">100</spd>
<hc type="int">100</hc>
<pd type="int">100</pd>
<pr type="int">100</pr>
</object>
<object name="orc1">
<inherit name="editor_object" />
<inherit name="npc" />
<hostile type="boolean">true</hostile>
<dead type="boolean">false</dead>
<alias>orc</alias>
<cur_hp type="int">999</cur_hp>
<max_hp type="int">999</max_hp>
<str type="int">25</str>
<end type="int">25</end>
<dex type="int">25</dex>
<agi type="int">25</agi>
<spd type="int">25</spd>
<hc type="int">25</hc>
<pd type="int">25</pd>
<pr type="int">25</pr>
</object>
</object>
<turnscript name="game_turns">
<enabled />
<script>
sa
game.turns = game.turns + 1
</script>
</turnscript>
<command name="fight">
<pattern>fight #text#</pattern>
<script>
battle_system (game.pov,text)
</script>
</command>
<type name="char">
<cur_hp type="int">0</cur_hp>
<drop type="boolean">false</drop>
<defending type="boolean">false</defending>
<max_hp type="int">0</max_hp>
<str type="int">0</str>
<end type="int">0</end>
<dex type="int">0</dex>
<agi type="int">0</agi>
<spd type="int">0</spd>
<hp type="int">0</hp>
<hc type="int">0</hc>
<pd type="int">0</pd>
<pr type="int">0</pr>
</type>
<type name="pc">
<inherit name="char" />
<statusattributes type="stringdictionary">hp = ;str = ;end = ;dex = ;agi = ;spd = ;hc = ;pd = ;pr = </statusattributes>
</type>
<type name="npc">
<inherit name="char" />
<dead type="boolean">false</dead>
<hostile type="boolean">false</hostile>
<displayverbs type="list">Look at; Talk; Fight</displayverbs>
</type>
<function name="cc">
msg ("What is your name?")
get input {
game.pov.alias = result
msg (" - " + game.pov.alias)
show menu ("What is your gender?", split ("male;female" , ";"), false) {
game.pov.gender = result
show menu ("What is your race?", split ("human;dwarf;elf" , ";"), false) {
game.pov.race = result
show menu ("What is your class?", split ("warrior;cleric;mage;thief" , ";"), false) {
game.pov.class = result
msg (game.pov.alias + " is a " + game.pov.gender + " " + game.pov.race + " " + game.pov.class + ".")
wait {
ClearScreen
}
}
}
}
}
</function>
<function name="sa">
game.pov.hp = game.pov.cur_hp + " / " + game.pov.max_hp
</function>
<function name="battle_system" parameters="self,text" type="boolean">
first_value = false
enemy = GetObject (text)
if (enemy = null) {
foreach (obj,AllObjects()) {
if (obj.alias=text) {
enemy = obj
}
}
}
if (enemy = null) {
msg ("There is no " + text + " here.")
first_value = false
}
else if (not Doesinherit (enemy,"npc")) {
msg ("You can not battle that!")
first_value = false
}
else if (not npc_reachable (enemy)) {
msg ("There is no " + enemy.alias + " in your vicinity.")
first_value = false
}
else if (GetBoolean (enemy,"dead") = true) {
msg (enemy.alias + " is already dead.")
first_value = false
}
else if (GetBoolean (enemy,"hostile") = false) {
msg (enemy.alias + " is not hostile.")
first_value = false
}
else if (battle_sequence (self,enemy) = true) {
msg ("The battle is over.")
first_value = true
}
return (first_value)
</function>
<function name="battle_sequence" parameters="self,enemy" type="boolean"><![CDATA[
second_value = false
if (enemy.dead = false) {
if (GetInt (self,"spd") > GetInt (enemy,"spd")) {
on ready {
msg ("You get to go first for this round")
if (self_battle_turn (self,enemy) = true) {
battle_sequence (self,enemy)
}
}
on ready {
if (enemy.dead = false) {
if (enemy_battle_turn (self,enemy) = true) {
msg ("The round has ended.")
}
}
}
on ready {
battle_sequence (self,enemy)
}
}
else if (GetInt (self,"spd") < GetInt (enemy,"spd")) {
on ready {
msg (enemy.alias + " gets to go first for this round.")
if (enemy_battle_turn (self,enemy) = true) {
msg ("It is now your turn.")
}
}
on ready {
if (self_battle_turn (self,enemy) = true) {
battle_sequence (self,enemy)
}
else {
msg ("The round has ended.")
}
}
on ready {
battle_sequence (self,enemy)
}
}
else if (GetInt (self,"spd") = GetInt (enemy,"spd")) {
if (RandomChance (50) = true) {
on ready {
msg ("You get to go first for this round")
if (self_battle_turn (self,enemy) = true) {
battle_sequence (self,enemy)
}
}
on ready {
if (enemy_battle_turn (self,enemy) = true) {
msg ("The round has ended.")
}
}
on ready {
battle_sequence (self,enemy)
}
}
else {
on ready {
msg (enemy.alias + " gets to go first for this round.")
if (enemy_battle_turn (self,enemy) = true) {
msg ("It is now your turn.")
}
}
on ready {
if (self_battle_turn (self,enemy) = true) {
battle_sequence (self,enemy)
}
else {
msg ("The round has ended.")
}
}
on ready {
battle_sequence (self,enemy)
}
}
}
}
else {
second_value = true
}
return (second_value)
]]></function>
<function name="self_battle_turn" parameters="self,enemy" type="boolean"><![CDATA[
third_value = false
msg (self.alias + " has " + self.cur_hp + " HP left.")
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
wait {
show menu ("What is your battle choice?", split ("Attack;Defend;Cast;Item;Run", ";"), false) {
switch (result) {
case ("Attack") {
fourth_value = false
if (RandomChance (GetInt (enemy,"agi") - GetInt (self,"spd")) = true) {
msg (enemy.alias + "evaded your attack!")
fourth_value = true
}
else if (RandomChance (GetInt (enemy,"Dex") - GetInt (self,"agi")) = true) {
msg (enemy.alias + "parried your attack!")
fourth_value = true
}
else if (RandomChance (GetInt (enemy,"agi") - GetInt (self,"dex")) = true) {
msg (enemy.alias + "blocked your attack!")
fourth_value = true
}
else if (RandomChance (GetInt (self,"dex") - GetInt (enemy,"spd")) = false) {
msg ("Your attack missed " + enemy.alias +"!")
fourth_value = true
}
else if (RandomChance (GetInt (enemy,"pr") - GetInt (self,"hc")) = true) {
msg ("Your attack got resisted by " + enemy.alias +"!")
fourth_value = true
}
else if (fourth_value = false) {
if (self.defending = true and enemy.defending = true) {
enemy.cur_hp = enemy.cur_hp - (crit_hit (self) * 2 * GetInt (self,"pd") / 2 + GetInt (self,"pd") * (GetInt (self,"str") - GetInt (enemy,"end")) / 100)
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
self.defending = false
}
else if (self.defending = true and enemy.defending = false) {
enemy.cur_hp = enemy.cur_hp - (crit_hit (self) * 2 * GetInt (self,"pd") + GetInt (self,"pd") * (GetInt (self,"str") - GetInt (enemy,"end")) / 100)
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
self.defending = false
}
else if (self.defending = false and enemy.defending = true) {
enemy.cur_hp = enemy.cur_hp - (crit_hit (self) * GetInt (self,"pd") / 2 + GetInt (self,"pd") * (GetInt (self,"str") - GetInt (enemy,"end")) / 100)
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
}
else if (self.defending = false and enemy.defending = false) {
enemy.cur_hp = enemy.cur_hp - (crit_hit (self) * GetInt (self,"pd") + GetInt (self,"pd") * (GetInt (self,"str") - GetInt (enemy,"end")) / 100)
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
}
}
}
case ("Defend") {
if (self.defending = false) {
self.defending = true
}
}
case ("Cast") {
self.defending = false
}
case ("Item") {
self.defending = false
}
case ("Run") {
self.defending = false
}
}
if (GetInt (enemy,"cur_hp") > 0) {
if (RandomChance (GetInt (self,"spd") - GetInt (enemy,"spd")) = true) {
msg ("You get an extra battle turn!")
self_battle_turn (self,enemy)
}
else {
msg ("Your battle turn is over.")
third_value = false
}
}
else if (GetInt (enemy,"cur_hp") <= 0) {
msg (enemy.alias + " is dead.")
msg ("You have won the battle!")
enemy.defending = false
enemy.dead = true
third_value = true
wait {
ClearScreen
}
}
}
}
return (third_value)
]]></function>
<function name="enemy_battle_turn" parameters="self,enemy" type="boolean"><![CDATA[
fifth_value = false
msg (self.alias + " has " + self.cur_hp + " HP left.")
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
result = GetRandomInt (1,3)
switch (result) {
case (1) {
sixth_value = false
if (RandomChance (GetInt (self,"agi") - GetInt (enemy,"spd")) = true) {
msg ("You have evaded the attack!")
sixth_value = true
}
else if (RandomChance (GetInt (self,"dex") - GetInt (enemy,"agi")) = true) {
msg ("You have parried the attack!")
sixth_value = true
}
else if (RandomChance (GetInt (self,"agi") - GetInt (enemy,"dex")) = true) {
msg ("You have blocked the attack!")
sixth_value = true
}
else if (RandomChance (GetInt (enemy,"dex") - GetInt (self,"spd")) = false) {
msg (enemy.alias +"'s attack missed!")
sixth_value = true
}
else if (RandomChance (GetInt (self,"pr") - GetInt (enemy,"hc")) = true) {
msg ("You resisted the attack!")
sixth_value = true
}
else if (sixth_value = false) {
if (enemy.defending = true and self.defending = true) {
self.cur_hp = self.cur_hp - (crit_hit (enemy) * 2 * GetInt (enemy,"pd") / 2 + GetInt (enemy,"pd") * (GetInt (enemy,"str") - GetInt (self,"end")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
enemy.defending = false
}
else if (enemy.defending = true and self.defending = false) {
self.cur_hp = self.cur_hp - (crit_hit (enemy) * 2 * GetInt (enemy,"pd") + GetInt (enemy,"pd") * (GetInt (enemy,"str") - GetInt (self,"end")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
enemy.defending = false
}
else if (enemy.defending = false and self.defending = true) {
self.cur_hp = self.cur_hp - (crit_hit (enemy) * GetInt (enemy,"pd") / 2 + GetInt (enemy,"pd") * (GetInt (enemy,"str") - GetInt (self,"end")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
}
else if (enemy.defending = false and self.defending = false) {
self.cur_hp = self.cur_hp - (crit_hit (enemy) * GetInt (enemy,"pd") + GetInt (enemy,"pd") * (GetInt (enemy,"str") - GetInt (self,"end")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
}
}
}
case (2) {
if (enemy.defending = false) {
msg (enemy.alias + " has choosen to defend itself.")
enemy.defending = true
}
}
case (3) {
enemy.defending = false
msg ("Cast")
}
}
if (GetInt (self,"cur_hp") > 0) {
if (RandomChance (GetInt (enemy,"spd") - GetInt (self,"spd")) = true) {
msg (enemy.alias + " gets an extra battle turn!")
wait {
enemy_battle_turn (self,enemy)
}
}
else {
msg (enemy.alias + " 's battle turn is over.")
fifth_value = true
}
}
else if (GetInt (self,"cur_hp") <= 0) {
msg (self.alias + " has died.")
msg ("GAME OVER")
finish
}
return (fifth_value)
]]></function>
<function name="npc_reachable" parameters="object" type="boolean">
value = false
foreach (x,ScopeReachableNotHeld ()) {
if (x=object) {
value = true
}
}
return (value)
</function>
<function name="crit_hit" parameters="object" type="int">
if (RandomChance (GetInt (object,"luck")) = true) {
value = 2
}
else {
value = 1
}
return (value)
</function>
</asl>


and my legend~key for my annoying abrevs:

01. cc = character creation function
02. sa = status attributes (mainly for implementing/displaying of ' cur / max ' stats) function
03. char = character object type ("pcs", "npcs", "monsters", etc., so, not a room, item, equipment, spell, etc)
04. pc = playable character object type ("player" characters / game.povs)
05. npc = non-playable character ("people", "monsters", and etc, so not a "player" character / not a game.pov, I'm going to have a hostility system, so any npc can be friendly or hostile, instead of having an actual "monster/enemy" type set aside)
06. hp = hit points (life) stat attribute
07. mp = mana points (magic) stat attribute
08. str = strength (physical damage, carry weight / equipment requirement, etc) stat attribute
09. end = endurance (physical defense, and etc) stat attribute
10. dex = dexterity (weapon~attack skill, think of this as "if your attack connects or not, do you 'whiff' or not", so not to gete confused with hc, and etc) stat attribute
11. agi = agility (dodging/evading, and etc) stat attribute
12. spd = speed (who goes first in battle, extra battle turns, escaping from battle, and etc) stat attribute
13. hc = hit chance (think of this more as piercing their armor or not, so not to get confused with dex, and etc) stat attribute
14. pd = physical damage stat attribute
15. fp = fire damage stat attribute
16. wp = water damage stat attribute
17. ap = air damage stat attribute
18. ed = earth damage stat attribute
19. ld = light damage stat attribute
20. dd = dark damage stat attribute
21. pr = physical resistance stat attribute
22. fr = fire resistance stat attribute
23. wr = water resistance stat attribute
24. ar = air resistance stat attribute
25. er = earth resistance stat attribute
26. lr = light resistance stat attribute
27. dr = dark resistance stat attribute
28. defending = boolean (reduces damage done for that character and increases the damage done by that character, if they chosoe to attack on the next turn)
29. escaped = boolean, run from battle (not completed/implemented yet)
30. hostile = boolean, any npc can be friendly or a(n) "monster/enemy", based upon a hostility scale (0-100), but not completed
31. dead = boolean
32. crit_hit = critical hit (bonus damage based upon luck)
33. luck = luck stat attribute
34. lvl = level stat attribute
35. exp = experience stat attribute
36. cash = cash stat attribute (currency)
37. lvlup = level up function


and if you want to look at Pertex' Combat Library (the structure of which is what I used for my combat code):

viewtopic.php?f=18&t=2660

and just here is a good link too:

viewtopic.php?f=10&t=4740&hilit=Pertex+Combat+Library

------

for Equipment:

Pixie's Simple Combat Library
Pixie's Clothing Library
Chase's Wearables Library
Pertex' Combat Library

-----

for Magic:

Pixie's Spell Library (I think it's merged into: Pixie's Simple Combat Library, but not sure), or it's also found on the wiki (under~in the 'how to' section)

-----

for Items:

Sora's Stackable Library

-----

Dialogue~Conversations:

Jay's and Pixie's whatever-called Libraries (I think)

----

and some other various good RPG aspect ~ advanced-coding libraries too (Transportation, 'carry-able lamp ~ light source', and etc)

-----

ask if you got any questions about anything!

clockworkdragon
*Clockwork Dragon's brain explodes from all that coding* @.@

So...out of curiosity, how do people normally do combat in their games with out downloading a library?

I should also mention that I have yet to try any of this yet as life just got unexpectedly busy :v

The current story I'm working on is going to flow more like story book than blow for blow combat. So I was thinking of using a system where the player would a single dice to reach a certain number for critical success, success, failure, and critical failure. The players stat in the area would determin the type of dice they roll.

Just for a rough example:

Base stat 1 = D6
stat 2 = D8
stat 3 = D10
stat 4 = D12
stat 5 = D20

etc etc
I will still keep all these ideas in mind, as I want to write other stories that flow more like an rpg than story book, but for now does that sound plausible and easy to use for what I have in mind?

clockworkdragon
man...I am out of practice. I forgot the language behind the code that add's to a variable or attribute.

HegemonKhan
just guessing as I've not gotten around to playing many of others' games:

obviously, it first depends on your coding ability and the type of game you're making obviously. If (non-good coding) people are able to, most probably use Pixie's Simple Combat Library, if they're making a RPG. Otherwise, they make a more simple and non-rpg type of 'combat' system.

some useful links for you:

http://docs.textadventures.co.uk/quest/ ... eroll.html
http://docs.textadventures.co.uk/quest/ ... hance.html
http://docs.textadventures.co.uk/quest/ ... omint.html
http://docs.textadventures.co.uk/quest/ ... ouble.html

http://docs.textadventures.co.uk/quest/ ... _menu.html
http://docs.textadventures.co.uk/quest/ ... witch.html

-----

quest's language: XML (eXtensible Markup Language)

general syntax structure of an Attribute:

Object_name.Attribute_name = Value_or_Expression

examples: player.strength_integer = 100

-----

Addition examples:

player.strength_integer = player.strength_integer + 5
player.strength_integer = player.strength_integer + player.endurance_integer

----

Subtraction examples:

player.strength_integer = player.strength_integer - 4
player.strength_integer = player.strength_integer - player.endurance_integer

----

Multiplication examples:

player.strength_integer = player.strength_integer * 3
player.strength_integer = player.strength_integer * player.endurance_integer

----

Division examples:

player.strength_integer = player.strength_integer / 2
player.strength_integer = player.strength_integer / player.endurance_integer

-----

Buying transaction example:

wooden_sword.parent = shop_keeper

<function name="buy_function"><![CDATA[
if (player.cash_integer >= wooden_sword.cash_integer) {
player.cash_integer = player.cash_integer - wooden_sword.cash_integer
shop_keeper.cash_integer = shop_keeper.cash_integer + wooden_sword.cash_integer
wooden_sword.parent = player
msg ("You buy the wooden sword.")
} else {
msg ("Sorry, you don't have enough for the wooden sword.")
}
]]></function>


-----

Selling transaction example:

wooden_sword.parent = player

<function name="sell_function"><![CDATA[
if (shop_keeper.cash_integer >= wooden_sword.cash_integer) {
shop_keeper.cash_integer = shop_keeper.cash_integer - wooden_sword.cash_integer
player.cash_integer = player.cash_integer + wooden_sword.cash_integer
wooden_sword.parent = shop_keeper
msg ("You sell the wooden sword to the shop keeper.")
} else {
msg ("Sorry, but the shop keeper doesn't have enough to buy back the wooden sword, or you decided to hold onto the wooden sword instead of selling it back to the shop keeper")
}
]]></function>


-----

'show menu' + 'switch' example:

(simple self-then-enemy turn combat system)

<function name="fight_function" parameters="enemy_parameter"><![CDATA[
if (enemy_parameter.dead_boolean = false) {
show menu ("Choose your action!", split ("attack;defend;magic;item;escape", ";"), false) {
switch (result) {
case ("attack") {
// your turn:
enemy_parameter.life_integer = enemy_parameter.life_integer - player.damage_integer
msg ("You attack the " + enemy_variable.alias +".")
if (enemy_parameter.life_integer <= 0) {
enemy_parameter.dead_boolean = true
msg ("You killed the " + enemy_variable +".")
} else {
// enemy's turn:
value_variable = GetRandomInt (1,3)
if (value_variable = "1") {
player.life_integer = player.life_integer - enemy_parameter.damage_integer
if (player.life_integer <= 0) {
msg ("You were killed.")
msg ("GAME OVER")
finish
}
} else if (value_variable = "2") {
// defend scripting for your enemy's turn
} else if (value_variable = "3") {
// magic scripting for your enemy's turn
}
}
}
case ("defend") {
// scripts
}
case ("magic") {
// scripts
}
case ("item") {
// scripts
}
case ("escape") {
// scripts
}
}
}
} else if (enemy_parameter.dead_boolean) {
msg ("The " + enemy_parameter.alias + " is dead already.")
}
]]></function>


are you able to follow+understand this code? (decent-level of combat coding isn't too difficult... as it might seem, though it does take awhile to learn), or is this too confusing difficult for you? (if it is, let me know, and I'll try to explain it step by step to you, until you get it, I won't give up until you can do it fully on your own, hehe!)

Silver
Historically Text Adventures were more about puzzle solving than combat afaik so examples might be a bit thin on the ground. The fighting fantasy books basically added a die roll to your strength and their die roll to their strength with the highest number being the victor for that round and the loser reducing their stamina by two. Stamina reaching zero was death.

HegemonKhan
using the 'DiceRoll' is a very simple way to do combat:

you attack the orc, doing damge to it:
orc.life_integer = orc.life_integer - DiceRoll (1d6)

orc attacks you, doing damage to you:
player.life_integer = player.life_integer - DiceRoll (1d6)

clockworkdragon
Ok yes, that is starting to make sense. Thank you all for you r help on this :D

If anyone needs help with something feel free to ask. Although my experience is writing the actual story part, not the coding. I am not, and will never claim, to be a professional writer but you don't need to be a professional to make a scene come to life :)

Unfortunately unless someone needs help with sprucing up a setting, making character descriptions more stream lined and stand out more, or etc etc there isn't a whole lot I can do in the way of coding XD

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums