Comments (7)
It is. It seems like something I can't fix, although I have tried in many ways to code it differently. I thought what I had done worked.
I'll try to fix it again and I will see.
Did the health go back down after?
from adventureroad.
It's hard to tell. I got attacked pretty much immediately after that, I believe, so I'm not sure if it resolved itself or not. I think you could potentially just insert some logic at the bottom of your damage calculation.
As a suggestion:
(if: $damage < 0)[
(set: $damage to 0)
]
Or something, I don't know what exactly you're working with. Probably better than testing health to see if it's over the max (which you should still also do, if you are doing so).
Just my two cents. Cool game, though, I quite liked it.
from adventureroad.
I am currently using a variable as an equalizer, here is what it looks like:
`(elseif: $turn is "enemy")[
(link: "Continue")[
(set: $log to "enemy")
(set: $turn to "you")
(if: $dp > $eap)[
(set: $equalizer = $dp - $eap)
(set: $hp to it - $equalizer)
]
(else:)[
(set: $hp to it - $eap)
(set: $hp to it + $dp)]
(goto: "Combat")]]
(if: $ehp > $mhp)[(set: $ehp to $mhp)]
(if: $hp > $maxhp)[(set: $hp to $maxhp)]
(if: $hp <1)[(goto: "lose")]
(if: $ehp <1)[(goto: "Win")]`
It should work, but I don't see why it doesn't.
from adventureroad.
Sorry. Trying to comment on my phone and messed it all up.
from adventureroad.
That's alright. I also checked your profile out and if you need help on your holy land project I'd be happy to help
from adventureroad.
(if: $dp > $eap)[
(set: $equalizer = $dp - $eap)
(set: $hp to it - $equalizer)
]
(else:)[
(set: $hp to it - $eap)
(set: $hp to it + $dp)]
...
This will stop it, but doesn't it also mess up how defense works? If we plug in numbers, assuming player defense is 3 and enemy attack is 2 for sake of ease:
(if: 3 > 2)[
(set: 1 = 3 - 2)
(set: $hp to it - 1)
]
So having HP that is higher than the enemy's attack power actually increases the damage you take. At least that's my read of it, based on this code.
defense | enemy attack | damage taken |
---|---|---|
1 | 2 | 1 |
2 | 2 | 0 |
3 | 2 | 1 |
4 | 2 | 2 |
Maybe something like this to replace the whole thing?
(unless: $dp > $eap)[
(set: $hp to it - $eap)
(set: $hp to it + $dp)]
...
Then, no damage is taken if defense is >= to attack power.
Or, if you want to have some type of minimum damage:
(if: $dp > $eap)[
(set: $hp to it - 1)
](else:)[
(set: $hp to it - $eap)
(set: $hp to it + $dp)
]
...
I also checked your profile out and if you need help on your holy land project I'd be happy to help
Awesome, thank you. I'll be needing some testing help sooner rather than later. I saw you filled out the form on my devlog. I'll be in touch. I'm hoping to get a handful of Twine creators together so we can all share the testing load with each other.
from adventureroad.
Thank you a lot, I will be using that code
(unless: $dp > $eap)[
(set: $hp to it - $eap)
(set: $hp to it + $dp)]
The problem with my code is I was supposed to take away the $equalizer after having been healed whatever amount, but the problem was that I closed the bracket and put an else block, therefore removing the normal "healing" and thus removing the equalizer number from the health.
And I can't wait to test your game, seems like you have been working on it for far longer than I have.
I think I can close this now, so I will do so, thanks again.
from adventureroad.
Related Issues (13)
- Save game not saving?
- Add a free license HOT 4
- Can't leave potion vendor HOT 2
- The innkeeper is a thief! (Had 50 Gold, room costed 5/night, next day woke up with 40) HOT 2
- Error on Page HOT 3
- Taking damage less than defence heals the hero HOT 1
- [Suggestion] "Leave" become "Leave Market" or new option. HOT 2
- [Spelling] oay to pay
- [Weapon name] "0" should be "stick" ? HOT 4
- [Spelling] nighgt to night
- [Spelling] Several in 2 paragraphs. HOT 2
- Need Ideas
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adventureroad.