mob
proc/UserDcheck(mob/M)
if(M.hp<=0 && M.monster == 0 && src.gym1poke == 0)
if(M.tourny == 0)
M<<"<I><small><font color = white><font face = 'Comic Sans MS'>You died!"
M.hp=M.maxhp
M.loc=locate(1,3,1)
M.PK=0
if(M.hp <= 0 && M.monster == 0 && src.gym1poke == 0)
if(M.tourny == 1)
FightFinish(M)
if(src.hp < 0 && src.monster == 1 && src.gym1poke == 0)
respawn(src.type, src.loc, 100)
del(src)
if(src.hp<=0 && src.monster == 0 && src.gym1poke == 0)
usr.hp=M.maxhp
usr.loc=locate(1,3,1)
else
if(src.hp < 0 && src.monster == 1 && src.gym1poke == 1)
del(src)
view(8) << "Sky: Nice work, you've proven yourself worthy for the Swift Badge, with this badge you may now cut down the tree's blocking the path to Absolife city. Good Luck."
usr.contents+= new/obj/Badges/Swift_Badge
verb
Tackle()
set category = "Pokemon"
for(var/mob/M in get_step(usr,usr.dir))
var/dmg = rand(src.strength-M.defense,src.strength)
if(src.Pokemon == 1 && M.Battle == 1 && dmg > 0 && src.Tackle_Again == 0 && src.tourny == 0)
usr << "<font face = 'Comic Sans MS'><font color=red>You Tackle [M.name] for [dmg] HP!"
M << "<font color = white><font face = 'Comic Sans MS'>[src] Tackles you for [dmg] damage!!"
s_damage(M,dmg,"white")
usr.Tackle_Again = 1
sleep(usr.speed)
usr.Tackle_Again = 0
if(M.hp <= 0 && M.monster == 0 && M.tourny == 0)
usr << "<font face = 'Comic Sans MS'><font color=red><b><i>You have defeated [M.name]!"
usr.exp += rand(30,35)
M.hp = M.maxhp
M.loc = locate(1,3,1)
M.Battle = 0
UserDcheck(M)
if(usr.exp >= usr.expneeded && usr.monster == 0 && usr.tourny == 0)
usr.LevelUp()
M << "<font face = 'Comic Sans MS'><font color=red><i>You fainted!"
M.hp = M.maxhp
M.loc = locate(1,3,1)
M.Battle = 0
if(src.Pokemon == 1 && M.Battle == 1 && dmg > 0 && src.Tackle_Again == 0 && src.tourny == 1)
usr << "<font face = 'Comic Sans MS'><font color=red>You Tackle [M.name] for [dmg] HP!"
M << "<font color = white><font face = 'Comic Sans MS'>[src] Tackles you for [dmg] damage!!"
s_damage(M,dmg,"white")
usr.Tackle_Again = 1
sleep(usr.speed)
usr.Tackle_Again = 0
if(M.hp <= 0 && M.monster == 1 && M.gym1poke == 1 && M.tourny == 0)
usr << "<font face = 'Comic Sans MS'><font color=red><b><i>You have defeated [M.name]!"
UserDcheck(M)
if(M.hp <= 0 && M.monster == 0 && M.tourny == 0)
usr << "<font face = 'Comic Sans MS'><font color=red><b><i>You have defeated [M.name]!"
usr.exp += rand(30,35)
M.hp = M.maxhp
M.loc = locate(1,3,1)
FightFinish()
M.Battle = 0
UserDcheck(M)
if(usr.exp >= usr.expneeded && usr.monster == 0 && usr.tourny == 1)
usr.LevelUp()
M << "<font face = 'Comic Sans MS'><font color=red><i>You fainted!"
M.hp = M.maxhp
FightFinish()
M.loc = locate(1,3,1)
M.Battle = 0
if(M.Battle == 1 && usr.monster == 0 && dmg > 0)
M.hp -= dmg
if(usr.level >= 10 && usr.Battle == 1)
usr.exp += rand(50,75)
if(usr.exp >= usr.expneeded)
usr.LevelUp()
return
if(usr.level >= 20 && M.Battle == 1)
if(src.Pokemon == 1 && usr.monster == 0)
usr.exp += rand(150,200)
if(usr.exp >= usr.expneeded)
usr.LevelUp()
return
if(M.Battle == 0 && usr.monster == 0)
usr << "<font face = 'Comic Sans MS'><font color=white>You must be in a battle zone to battle, ask a moderator for more info on battle zones."
return
if(dmg < 1 && M.Battle == 1)
usr << "<font face = 'Comic Sans MS'><font color=white>Your move was uneffective."
return
mob
Skys_Pidgeotto
icon = 'Pidgey.dmi'
name = "Sky's Pidgeotto"
icon_state = "3"
desc = "Gym 1"
hp = 3000
Pidgey = 1
gym1poke = 1
maxhp = 3000
player = 0
strength = 100
Expg = 2
level = 70
monster = 1
Pokemon = 1
PK = 1
NPC = 0
New()
. = ..()
spawn()
Wander()
proc/Wander()
while(src)
var/mob/Pokemon/P = locate() in oview(src)
if(P)
step_towards(src,P)
else
step_rand(src)
sleep(5)
sleep(5)
spawn(5)
Wander()
Bump(mob/Pokemon/M)
if(ismob(M))
Fight(M)
..()
else
return
proc/Fight(var/mob/Pokemon/M)
var/damage = src.strength
if(src.hp<=0 && src.desc == "Gym 1")
usr.BeatGym1 = 1
usr << "<font color = white><font face = 'Comic Sans MS'> You recieved a Swift Badge from Blake"
UserDcheck(src)
if(src.hp<=0 && src.monster == 1)
usr.BeatGym1 = 1
usr << "<font color = white><font face = 'Comic Sans MS'> You recieved a Cheri berry from [src]'s drop."
UserDcheck(src)
else
if(M.hp <= 0 && M.monster == 0)
M.hp -= damage
M << "<font color = white><font face = 'Comic Sans MS'>[src] attacks you for [damage] damage!!"
src<<"<font color = white><font face = 'Comic Sans MS'>You attack [M] for [damage] damage!!"
UserDcheck(M)
if(M.hp >= 0 && M.monster == 0)
M.hp -= damage
M << "<font color = white><font face = 'Comic Sans MS'>[src] attacks you for [damage] damage!!"
src<<"<font color = white><font face = 'Comic Sans MS'>You attack [M] for [damage] damage!!"
UserDcheck(M)
Problem description: I'm trying to make npc gym leaders that creates a pokemon with the variable, gym1poke = 1, and i'm trying to make it so if you defeat the pokemon it
will give that pokemon the badge(Swift Badge) when it is defeated, but for some reason It won't give the player the badge, and won't say what Sky is supposed to say to the player. Any help with this? The codes in order are, The death code, The Tackle code, and the Pidgeotto with the gym1 poke = 1 variable.