Jump to content

Battle Script Help


Monk3h

Recommended Posts

Right, i need help with a battle script for my game.

 

Its not going too be too complicated i hope i just need a few ideas on where to start. Ofc if anyone has some spare time on there hands an wishes too help me further that would be great!

 

Basicly im trying to make a battle script for Army vs Army kind of thing. Each each tribe can buy there own troops of diferent verietys and then send them at the other tribe to fight!

 

Each unit type has there own HP and dmg points. but id like for some units to be more efective against certain types of units so people dont just buy loads of the 'best' unit type.

 

I have a table for the troops and there is a row for each type of unit. The feilds in this table are.

 

id, name, type, cost, desciprion, hp, dmg, fire.

 

 

hp = health

 

dmg =  Damage

 

fire = what place it fires in the battle.

 

 

I need my script to select the first unit to fire by its 'fire' then have the dmg done reduce all the units its fireing ats 'hp' over an average. Then update how many units died (if a units hp reaches 0 it dies) then select the second unit to fire and do this over and over untill the last unit has fired. Not untill some one has lost all there units but untill 1 of each unit has had its turn.

 

Any Advice/help? XD

Link to comment
https://forums.phpfreaks.com/topic/103097-battle-script-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.