Author Topic: Combat system  (Read 673 times)

Offline snw

  • Level 5
  • *
  • Posts: 15
  • Reputation: +0/-0
    • View Profile
Combat system
« on: June 03, 2010, 11:56:54 AM »
Hi there,
i dont want to make a lot of topics so ill post all my questions here.

Question no.1
Could someone help me making a BASIC turn by turn combat system
I have an explore.php in attachment and i want to make it like this :
Player attacks Mob
Mob attacks Player
>> Player now should have options what to do.   Attack     Spell    Use Potion to regenerate HP
Player attacks mob       <  + damage done by spell  or normal dmg if he chosen Attack
Mob attacks Player    ...etc.

Question no.2
How to make travel times
Player want to travel to xxx
it will took 1hour , it will display the clock and after the timer expires it will exexute a query

Question no.3
A hp and <mana>  regeneration over time . like every 1 min +1 HP

Thats all :) thx for reading and sorry for my bad english , i've tried as much as i can :D
« Last Edit: June 04, 2010, 01:13:42 PM by snw »

Offline Nox

  • Level 35
  • **
  • Posts: 738
  • Reputation: +12/-2
    • View Profile
Re: Combat system
« Reply #1 on: June 04, 2010, 02:57:02 PM »
1)
Basicly you'll have a php with combat handling and html/php with player options ...this could be in the same page with combat handling part being on top

So a players choses action by form and sends it to the combat script... it will evaluate that action and immediately handle the mob's action and both results will be listed for player and the choosing form displayed again

2)
In database you'll have actions table like id_player, action, time_finish ... upon loading page you'll take a look there and if there are actions that already happened you evaluate them and delete the row(s)

Downside is - if the check is triggered by the certain player and different player need to list all players in area, it would either display possibly outdated info or you'd need to check all area-changing actions ... or use CRON but that may have downsides... if CRON or not...there are many talks here, use search

3) Pretty much the same... you store last_click time in DB for many purposes* and one will be this regeneration... you'll see how many minutes it's been since the player requested a page and for every one you'll add hp/mana

* others may be unlogging players that hadn't been active, possibly deleting long inactive players etc.
Meet us at an IRC irc.freenode.net #bbg as well
Enjoy http://spiritbeacon.noxart.cz/ !

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal