Simple Turn RPG combat for the web quest

I actually made a small game just so I could get the combat down. Originally I only wanted it as practice for my Pokémon game, but I decided to make it into an official game.
I wanted to share the code so others will have an easier time with turn-based RPG combat, or at least the closest I could make it.

I use the web editor, so I suppose that means this only works for the web editor. Although I figure most people can look at it and figure out what's going on.

(Most of) the code I put up on a deviantart document. (link) http://jjj444555.deviantart.com/journal/Random-Code-1-691535053
The brackets are messed up, so don't paste it directly in the code. Edit it first.
I actually made a new deviantart account just for my text games.

The code is a modified form of ThePixie's Zombie Adventure Tutorial. (link) https://github.com/ThePix/quest/wiki/The-Zombie-Apocalypse-(on-the-web-version)
I re-purposed the turnscript into a function.

The result is that you have to press "Attack" or "shoot" to battle. The enemies follow you around once you attack them once, and I'm sure there are ways to lock a player in a room if needed/if you wanted to.

Also, don't paste in everything at once. Take breaks. Last time I checked, my game (in all) was 800~ kb. (1000 kb = 1 mb)

Game link, in case someone wanted to look at it/play it. http://textadventures.co.uk/games/view/xb0ge9kzbewhodrtmxnnqw/the-legend-of-the-secret-of-the-smelly-stinky-fish

Also includes:
Healing
Buying/Selling (until the next Quest update comes out anyways)


awesome library, thanks for sharing, this will be of great help to/for lots of poeple!


Sorry, forgot something.

Type this to spawn enemies.
Go to room- go to scripts. Paste this (below) in, "after entering the room."
SpawnTroll (this)

And if you want, this will stop enemies form following you.
Go to room- go to scripts. Paste this (below) in, "after entering the room."
player.attackers = NewObjectList()
msg ("You slam the door, safe at last!")
player.parent = this.to


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

Support

Forums