Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Harlowe 1.2.2 | Unable to "block" or "replace" if not enough $mana

$
0
0
This is currently the code I have for the "battle system" ;
<div id="you">You: $currenthp/$maxhp
You have $mana energy left
{(if: $turn is "you")[

(link: "Report")[
(set: $ehp to it - $weapondamage)
(set: $atk to "Punch")
(set: $atkdmg to $weapondamage)
(set: $turn to "enemy")
(set: $log to "atk")
(goto: "Combat")]

(link: "Repfuck")[
(if: $mana <5)(replace: ?Repfuck)[
No Energy]
(set: $ehp to it - $mdmg)
(set: $matk to "Repfuck")
(set: $mana to $mana -15)
(set: $turn to "enemy")
(set: $log to "magic")
(goto: "Combat")]
]


(elseif: $turn is "enemy")[
(link: "Continue")[
(set: $log to "enemy")
(set: $turn to "you")
(set: $currenthp to it - $eatk)
(goto: "Combat")]
]
(if: $currenthp <1)[(goto: "Lose")]
(if: $ehp <1)[(goto: "Win")]
</div>}

The thing is, when the player have less than 5 mana, he can still cast the "special" ability


I'm new to Twine so sorry if it's basic, it's my first attempt at making a game ._.

Viewing all articles
Browse latest Browse all 1844

Trending Articles