ID:161723
 
So, I have a list of physical attacks for the combat system, but I want to add more attacks, under special conditions like you use a "special" skill and it adds it to the list. And then checks to see if the skill is in the list.
well you should probably use if
like if they have to have unher 10 hp left to use then it would be like this
mob
verb
super_attack(mob/M as mob in oview(1))
set category = "name of list u put it in" //or what ever
if(usr.hp<10)
if (M.HP <= 0)
usr<<"[M] already dead!!"
else
usr << "You attack [M] for [damage] damage!"
oview() << "[usr] attacks [M]!"
var/damage = rand(15,100)
world << "[damage] damage!"
M.HP -= damage
//then you could add some exp aditions here, proc callings or what ever



then you can also add other conditions


mob
verb
super_attack(mob/M as mob in oview(1))
set category = "name of list u put it in" //or what ever
if(usr.hp<10)
if (M.HP <= 0)
usr<<"[M] already dead!!"
if(usr.energy<124)
usr<<"your about to die"
if(usr.whateverelseconditionyouhave<20)
else
usr << "You attack [M] for [damage] damage!"
oview() << "[usr] attacks [M]!"
var/damage = rand(15,100)
world << "[damage] damage!"
M.HP -= damage


just depends on how many conditions you want (you do have to
have the vars in the game or dream maker gets mad @ u :P
In response to RanEsu
RanEsu wrote:
well you should probably use if
like if they have to have unher 10 hp left to use then it would be like this
> mob
> verb
> super_attack(mob/M as mob in oview(1))
> set category = "Fighting" //or what ever
> if(usr hp<10)
> if (M.HP <= 0)
> usr<<"[M] already dead!!"
> else
> usr << "You attack [M] for [damage] damage!"
> oview() << "[usr] attacks [M]!"
> var/damage = rand(15,100)
> world << "[damage] damage!"
> M.HP -= damage
> M.DeathCheck()
> //then you could add some exp aditions here, proc callings or what ever
>



No more like, you use a skill called "power-up" and it gives you the skill "super attack" by adding it to the list of your skills, but if it doesn't fit the right conditions then it is never added to the list.
In response to Lundex
ok then try this
mob
var
inpower = 0
mob
verb
PowerUp()
if(usr.inpower==1)
usr.overlays -= 'energys.dmi'
//str -= 20 goes here, but id have to add code to ur game here for that to work
usr.inpower = 0
else
usr.overlays += 'energys.dmi'//you get overlays
usr.health -= 10
//str += 20 goes here, but id have to add code to ur game for it to work
usr.inpower = 1
usr<<"you use your powers"
DeathCheck()//just to check if he died from using the power up
mob
verb
super_attack(mob/M as mob in oview(1))
set category = "Fighting" //or what ever
if(usr.inpower==1)
if (M.HP <= 0)
usr<<"[M] already dead!!"
else
usr << "You attack [M] for [damage] damage!"
oview() << "[usr] attacks [M]!"
var/damage = rand(150,200)
world << "[damage] damage!"
M.HP -= damage
M.DeathCheck()
//then you could add some exp aditions here, proc callings or what ever
In response to RanEsu
Yep, thats what I was looking for thanks..
In response to Lundex
forgot about somthing

mob
var
inpower = 0
mob
verb
PowerUp()
if(usr.inpower==1)
usr.overlays -= 'energys.dmi'
usr.verbs-= new /mob/verb/super_attack
//str -= 20 goes here, but id have to add code to ur game here for that to work
usr.inpower = 0
else
usr.overlays += 'energys.dmi'//you get overlays
usr.health -= 10
usr.verbs+= new /mob/verb/super_attack
//str += 20 goes here, but id have to add code to ur game for it to work
usr.inpower = 1
usr<<"you use your powers"
DeathCheck()//just to check if he died from using the power up
mob
verb
super_attack(mob/M as mob in oview(1))
set category = "Fighting" //or what ever
if(usr.inpower==1)
if (M.HP <= 0)
usr<<"[M] already dead!!"
else
usr << "You attack [M] for [damage] damage!"
oview() << "[usr] attacks [M]!"
var/damage = rand(150,200)
world << "[damage] damage!"
M.HP -= damage
M.DeathCheck()
//then you could add some exp aditions here, proc callings or what ever
In response to RanEsu
Just to say the least - make sure you don't use new() on verbs.
Though that code shouldn't be used anyway and be only an example (and quite a bad one unfortunately).