//The heart of the attack code
mob
var
attack
macro1
macro2
macro3
macro4
list
slot_1 = list("attack" = null, "slot occupied" = 0)
slot_2 = list("attack" = null, "slot occupied" = 0)
slot_3 = list("attack" = null, "slot occupied" = 0)
slot_4 = list("attack" = null, "slot occupied" = 0)
attack
var
id
proc
assign_attack(mob/pokemon/x, id)
if(x.slot_1["slot occupied"]==0)
x.slot_1["attack"] = id
x.slot_1["slot occupied"]=1
usr << output("Added","battle_output")
get_info(mob/pokemon/src)
if(istype(src,/mob/pokemon/Bulbasaur))
if(src.level <= 5) assign_attack(src,TACKLE)
if(istype(src,/mob/pokemon/Charmander))
if(src.level <= 5) assign_attack(src,SCRATCH)
if(istype(src,/mob/pokemon/Squirtle))
if(src.level <= 5) assign_attack(src,TACKLE)
if(istype(src,/mob/pokemon/Pidgey))
if(src.level <= 5) assign_attack(src,TACKLE)
attack
proc
Use(mob/pokemon/x)
activate(mob/pokemon/user)
usr << output("Activated","battle_output")
Use(user)
mob
verb
Slot_1()
for(var/mob/pokemon/x in world)
if(x.owned_pokemon && x.hp_ > 0)
//Not exactly sure what to put here
usr << output("Here","battle_output")
Slot_2()
set hidden = 1
// src.identifying_move()
Slot_3()
set hidden = 1
// src.identifying_move()
Slot_4()
set hidden = 1
// src.identifying_move()
//One of the programmed attacks
attack
Tackle
id = TACKLE
Use(mob/pokemon/X)
AttackType = "Normal"
Move_Poke = "Physical"
Attack = "Tackle"
if(Cooldown > 0)
return
else
for(X in world)
if(usr.controlled==X&&istype(X,/mob/pokemon))
for(var/mob/pokemon/hostile in get_step(X,X.dir))
flick('Icons/Pokemon Moves/Normal/Tackle.dmi',hostile)
var/inflict = hostile.DamageMultiplier(X)
hostile.hp_ -= round(inflict)
usr << output("<b><font color = blue>[X] has dealt [round(inflict)] damage to [hostile]","battle_output")
else return
Problem description:
The main issue is with my list, i am trying to create four slots. I assign a move id to a list but i am not sure how i can retrieve this id from the list so whenever someone uses the slot_1() verb they will be able to use w.e id is in the slot_1 list
You can basically have a list like so:
And then to access that slot you just do:
I hope this provides enough help.