ThePix / QuestJS

A major re-write of Quest that is written in JavaScript and will run in the browser.
MIT License
66 stars 12 forks source link

Combat Issues? #72

Closed jaowriter closed 1 year ago

jaowriter commented 2 years ago

Hello,

I have recently been working on a prototype in QuestJS and am having some issues with the combat.

I've imported "RPG" settings per the documentation and used a test "goblin" enemy. However, when attacking the monster in the game, it never attacks back. I've tried a number of settings / options (including making the create the weapon, creating a weapon and assigning it to it, setting isHostile to true - even though I believe this is the default)... and it just never attacks the player.

Are there more extensive examples of combat that I could review? Is this an issue in 0.9?

Thank you.

ThePix commented 2 years ago

The simple answer is that this is a work in progress, and the bit where the enemy attacks you has yet to be done properly (and I have got bogged down in darkness, dark vision, invisibility, etc.).

The general idea would be to give the goblin an agenda, with a new agenda option that includes something like this:

attack = Attack.createAttack(w.goblin, player)
attack.resolve(player, true, 0)

You may need to check if the goblin is dead before hand and the player is dead after.

A better solution will be around one day...

jaowriter commented 2 years ago

Thank you very much for the response! I kept thinking I was missing something. I appreciate your time.

ThePix commented 1 year ago

About a year later, I am going to close this the RPG library has moved on a fair bit in that time,