Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

What's wrong with my coding I'm using 2.0 Harlowe

I decided to make an rpg text battle adventure whatever.. I was bored, anyway all was going swell till I tried to implement a critical damage system where the hero/monster has a chance to deal basically critical damage x5 as much as regular I decided to try it only for the monster but it isn't working out this is my first time using twine so I don't know really, here's a copy of my code:
(if: (either: 0, 1) is 0)[
The ghoul takes a bite
(set: $hp to $hp - (if: (either:"yes","no") is "yes") [(random: 5,10)] is "no" [(random: 5,10)*5]))
(if: $hp < 1)[ You barely escape!]
(else:)[ Your health is $hp.
fight
main ]
]

(else:)[ You hit the ghoul somehow!
(set:$ghoul_hp = $ghoul_hp - (random: 5,10))
(if: $ghoul_hp < 1)[ What..What the hell are you!]
(else:)[
Its health is $ghoul_hp.
fight
main ]
]

Comments

  • ok I fixed it by adding extra coding thanks alot to you guys, though you haven't helped me I will post how I fixed it so people won't have the same problem in the future I added extra variables damage1 for the ghoul and damageh for the player you can basically just see it down:
    (if: (either: 0, 1) is 0)[
    The ghoul takes a bite
    (set: $hp to $hp - $damage1) (set: $damage1 to (either:(random: 5,10),((random: 5,10)*5)))
    (if: $hp < 1)[ You barely escape!]
    (else:)[ Your health is $hp.
    fight
    main ]
    ]

    (else:)[ You hit the ghoul somehow!
    (set:$ghoul_hp = $ghoul_hp - $damageh) (set: $damageh to (either:(random: 5,10),((random: 5,10)*5)))
    (if: $ghoul_hp < 1)[ What..What the hell are you!]
    (else:)[
    Its health is $ghoul_hp.
    fight
    main ]
    ]
  • Here's just a little tip; when you're writing code, highlight it all and press the 'C' button on the top, where it lets you put text in bold or italic and stuff.
    That way it looks like this.
    
Sign In or Register to comment.