proc/UserAttack(mob/animal/attacker,mob/animal/enemy)
var/vary = rand(1,6)
var/vary2 = rand(1,3)
var/power = (attacker.Attack - enemy.Defense)/2 + (vary/vary2)//Line 15
enemy.Health -= power
world << "[attacker] hits [enemy] for [power] damage!"
Deathcheck(enemy,attacker)
proc/Deathcheck(mob/animal/M,mob/animal/killer)
if(M.Health <= 0)
world << "Battle is over! [M] was killed by [killer]"
BattleEnd(M,killer)
else
UserAttack(M,killer)
That's the main battling part. It's basically that there are two owners with thier two animals. And thier animals fight each other. Ya know, like those cartoon shows.
Here's how I call the proc (For demo purposes only)
world/New()
..()
UserAttack(/mob/animal/Falcon,/mob/animal/Eagle)
And this is the bug I get.
runtime error: Cannot read /mob/animal/Falcon (/mob/animal/Falcon).Attack
proc name: UserAttack (/proc/UserAttack)
source file: Combat.dm,15
usr: null
src: null
call stack:
UserAttack(/mob/animal/Falcon (/mob/animal/Falcon), /mob/animal/Eagle (/mob/animal/Eagle))
: New()
What I am aiming for is this:
Both fighters choose thier monsters they want to battle.
Monsters come out.
Fighters choose attacks (in turn based)
Monsters attack (in turns)
Repeat steps 2-4 until battle is over.
Please help,
Sariat
Not sure, though. It's untested.