ID:178746
Apr 10 2002, 8:37 am
|
|
How would i make a code to set when the join a team (red/blue/whatever/) they are started at there base? instead of the main start point.. also How would i make the blast delete the player when the blast hits, heres the code: mob icon = 'player.dmi' verb say(T as text) world << "[src]:[T]" obj proc/Trigger(O) // Override this proc for objs that // do things when stepped on. By default // do nothing. turf Entered(O) // called when O enters the turf for(var/obj/Obj in src.contents) Obj.Trigger(O) // Obj was Trigger()ed by O obj/beam icon = 'beam.dmi' density = 0 var distance = 6 next_state Trigger(O) // you'll want to apply damage to O here if(ismob(O)) // make sure O is a mob var/mob/M = O // so we can use mob variables with M usr << " [M] has been hit by plasma" New(Loc) ..() for(var/mob/M in Loc) // look for mobs when the beam starts src.Trigger(M) // this beam hit mob M spawn(20) del(src) // remove the beam after 2 seconds proc/fireloop() distance-- if(distance>0) var/turf/newloc = get_step(src,dir) // one step ahead if(newloc && !newloc.density) // if the spot is there and not dense var/obj/beam/B = new(newloc) // create a beam at newloc B.icon_state = next_state B.dir = dir B.next_state = next_state B.distance = distance spawn() B.fireloop() // remove the spawn if you want it instantaneous mob/verb/Plasma_Ray() switch(dir) if(NORTHEAST) dir = NORTH if(NORTHWEST) dir = WEST if(SOUTHEAST) dir = EAST if(SOUTHWEST) dir = SOUTH var/turf/newloc = get_step(src,dir) var/obj/beam/B = new(newloc) B.dir = dir B.icon_state = "middle start" B.next_state = "middle" spawn() B.fireloop() newloc = get_step(src,turn(dir,45)) B = new(newloc) B.dir = dir B.icon_state = "ccw start" B.next_state = "ccw" spawn() B.fireloop() newloc = get_step(src,turn(dir,-45)) B = new(newloc) B.dir = dir B.icon_state = "cw start" B.next_state = "cw" spawn() B.fireloop() |
In response to Shadowdarke
|
|
i did. whats the code to del the player? when i put del src it just deletes the beam..
|
In response to ShadowSiientx
|
|
NEVERMIND i got it: del (O) :/ thnx!
|
In Tanks, I created the spawn zones as speacial areas. The icon_state of the spawn zone matches the name of the team color.
// locate the spawnzone
var/area/zone/A
for(A in world)
if(A.icon_state == C) break
if(!A)
world.log << "Could not find a spawnzone for [C]"
return
// get a random turf in the area
var/turf/T
while(!istype(T))
T = A.contents[rand(1,A.contents.len)]
// Move to the turf
loc = T
Handle beam damage and effects in the obj/beam/Trigger() proc.