mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
@@ -106,7 +106,7 @@
|
||||
/obj/item/ammo_casing/shotgun/dart
|
||||
name = "shotgun darts"
|
||||
desc = "A dart for use in shotguns."
|
||||
icon_state = "dart"
|
||||
icon_state = "blshell"
|
||||
projectile_type = "/obj/item/projectile/energy/dart"
|
||||
m_amt = 12500
|
||||
w_type = RECYK_METAL
|
||||
|
||||
@@ -16,16 +16,6 @@
|
||||
..()
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
if(cell_type)
|
||||
power_supply = new cell_type(src)
|
||||
else
|
||||
power_supply = new(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
return
|
||||
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber) return 1
|
||||
if(!power_supply) return 0
|
||||
@@ -42,3 +32,20 @@
|
||||
icon_state = "[modifystate][ratio]"
|
||||
else
|
||||
icon_state = "[initial(icon_state)][ratio]"
|
||||
|
||||
/obj/item/weapon/gun/energy/New()
|
||||
. = ..()
|
||||
|
||||
if(cell_type)
|
||||
power_supply = new cell_type(src)
|
||||
else
|
||||
power_supply = new(src)
|
||||
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
|
||||
/obj/item/weapon/gun/energy/Destroy()
|
||||
if(power_supply)
|
||||
power_supply.loc = get_turf(src)
|
||||
power_supply = null
|
||||
|
||||
..()
|
||||
|
||||
@@ -119,18 +119,18 @@
|
||||
else
|
||||
visible_message("\red [A.name] is hit by the [src.name] in the [parse_zone(def_zone)]!")//X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
|
||||
if(istype(firer, /mob))
|
||||
log_attack("<font color='red'>[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src.type]</font>")
|
||||
M.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
|
||||
firer.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
|
||||
msg_admin_attack("[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
|
||||
log_attack("<font color='red'>[key_name(firer)] shot [key_name(M)] with a [type]</font>")
|
||||
M.attack_log += "\[[time_stamp()]\] <b>[key_name(firer)]</b> shot <b>[key_name(M)]</b> with a <b>[type]</b>"
|
||||
firer.attack_log += "\[[time_stamp()]\] <b>[key_name(firer)]</b> shot <b>[key_name(M)]</b> with a <b>[type]</b>"
|
||||
msg_admin_attack("[key_name(firer)] shot [key_name(M)] with a [type] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
|
||||
if(!iscarbon(firer))
|
||||
M.LAssailant = null
|
||||
else
|
||||
M.LAssailant = firer
|
||||
else
|
||||
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>"
|
||||
msg_admin_attack("UNKNOWN shot [M] ([M.ckey]) with a [src] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
|
||||
log_attack("<font color='red'>UNKNOWN shot [M] ([M.ckey]) with a [src.type]</font>")
|
||||
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN/(no longer exists)</b> shot <b>[key_name(M)]</b> with a <b>[type]</b>"
|
||||
msg_admin_attack("UNKNOWN/(no longer exists) shot [key_name(M)] with a [type] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
|
||||
log_attack("<font color='red'>UNKNOWN/(no longer exists) shot [key_name(M)] with a [type]</font>")
|
||||
|
||||
if(A)
|
||||
if(firer && istype(A, /obj/structure/stool/bed/chair/vehicle))//This is very sloppy but there's no way to get the firer after its passed to bullet_act, we'll just have to assume the admins will use their judgement
|
||||
@@ -138,18 +138,18 @@
|
||||
if(JC.buckled_mob)
|
||||
var/mob/BM = JC.buckled_mob
|
||||
if(istype(firer, /mob))
|
||||
BM.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[BM]/[BM.ckey]</b> with a <b>[src.type]</b>"
|
||||
firer.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[BM]/[BM.ckey]</b> with a <b>[src.type]</b>"
|
||||
log_attack("<font color='red'>[firer] ([firer.ckey]) shot [BM] ([BM.ckey]) with a [src.type]</font>")
|
||||
msg_admin_attack("ATTACK: [firer] ([firer.ckey]) shot [BM] ([BM.ckey]) with a [src]") //BS12 EDIT ALG
|
||||
BM.attack_log += "\[[time_stamp()]\] <b>[key_name(firer)]</b> shot <b>[key_name(BM)]</b> with a <b>[type]</b>"
|
||||
firer.attack_log += "\[[time_stamp()]\] <b>[key_name(firer)]</b> shot <b>[key_name(BM)]</b> with a <b>[type]</b>"
|
||||
log_attack("<font color='red'>[key_name(firer)] shot [key_name(BM)] with a [type]</font>")
|
||||
msg_admin_attack("[key_name(firer)] shot [key_name(BM)] with a [type]") //BS12 EDIT ALG
|
||||
if(!iscarbon(firer))
|
||||
BM.LAssailant = null
|
||||
else
|
||||
BM.LAssailant = firer
|
||||
else
|
||||
BM.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[BM]/[BM.ckey]</b> with a <b>[src]</b>"
|
||||
log_attack("<font color='red'>UNKNOWN shot [BM] ([BM.ckey]) with a [src.type]</font>")
|
||||
msg_admin_attack("ATTACK: UNKNOWN shot [BM] ([BM.ckey]) with a [src]") //BS12 EDIT ALG
|
||||
BM.attack_log += "\[[time_stamp()]\] <b>UNKNOWN/(no longer exists)</b> shot <b>[key_name(BM)]</b> with a <b>[type]</b>"
|
||||
log_attack("<font color='red'>UNKNOWN/(no longer exists) shot [key_name(BM)] with a [type]</font>")
|
||||
msg_admin_attack("UNKNOWN/(no longer exists) shot [key_name(BM)] with a [type]") //BS12 EDIT ALG
|
||||
if (!forcedodge)
|
||||
forcedodge = A.bullet_act(src, def_zone) // searches for return value
|
||||
if(forcedodge == -1) // the bullet passes through a dense object!
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define SPELL_ANIMATION_TTL 2 MINUTES
|
||||
|
||||
/obj/item/projectile/animate
|
||||
name = "bolt of animation"
|
||||
icon_state = "ice_1"
|
||||
@@ -9,5 +11,5 @@
|
||||
/obj/item/projectile/animate/Bump(var/atom/change)
|
||||
if(istype(change, /obj/item) || istype(change, /obj/structure) && !is_type_in_list(change, protected_objects))
|
||||
var/obj/O = change
|
||||
new /mob/living/simple_animal/hostile/mimic/copy(O.loc, O, firer)
|
||||
new /mob/living/simple_animal/hostile/mimic/copy(O.loc, O, firer, duration=SPELL_ANIMATION_TTL)
|
||||
..()
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/*
|
||||
* Use: Caches beam state images and holds turfs that had these images overlaid.
|
||||
* Structure:
|
||||
@@ -180,6 +181,8 @@ var/list/beam_master = list()
|
||||
/obj/item/projectile/beam
|
||||
name = "laser"
|
||||
icon_state = "laser"
|
||||
invisibility = 101
|
||||
|
||||
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
|
||||
damage = 30
|
||||
damage_type = BURN
|
||||
@@ -187,76 +190,105 @@ var/list/beam_master = list()
|
||||
eyeblur = 4
|
||||
var/frequency = 1
|
||||
|
||||
/obj/item/projectile/beam/process()
|
||||
var/reference = "\ref[src]"
|
||||
|
||||
spawn(0)
|
||||
var/nextLoc = locate(Clamp(x + xo, 1, world.maxx), Clamp(y + yo, 1, world.maxy), z)
|
||||
var/target_dir
|
||||
|
||||
while(src && --kill_count >= 0)
|
||||
process()
|
||||
var/lastposition = loc
|
||||
var/reference = "\ref[src]" //So we do not have to recalculate it a ton
|
||||
var/first = 1 //So we don't make the overlay in the same tile as the firer
|
||||
spawn while(loc) //Move until we hit something
|
||||
if((!( current ) || loc == current)) //If we pass our target
|
||||
current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z)
|
||||
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
|
||||
//del(src) //Delete if it passes the world edge
|
||||
returnToPool(src)
|
||||
return
|
||||
step_towards(src, current) //Move~
|
||||
|
||||
if(loc == nextLoc)
|
||||
nextLoc = locate(Clamp(x + xo, 1, world.maxx), Clamp(y + yo, 1, world.maxy), z)
|
||||
if(isnull(loc))
|
||||
return
|
||||
if(lastposition == loc)
|
||||
kill_count = 0
|
||||
lastposition = loc
|
||||
if(kill_count < 1)
|
||||
//del(src)
|
||||
returnToPool(src)
|
||||
return
|
||||
kill_count--
|
||||
|
||||
step_towards(src, nextLoc, 0)
|
||||
target_dir = get_dir(src, nextLoc)
|
||||
if(!bumped && !isturf(original))
|
||||
if(loc == get_turf(original))
|
||||
if(!(original in permutated))
|
||||
Bump(original)
|
||||
|
||||
if(!("[icon_state][target_dir]" in beam_master))
|
||||
beam_master["[icon_state][target_dir]"] = image(icon, icon_state, 10, target_dir)
|
||||
if(!first) //Add the overlay as we pass over tiles
|
||||
var/target_dir = get_dir(src, current) //So we don't call this too much
|
||||
|
||||
loc.overlays += beam_master["[icon_state][target_dir]"]
|
||||
//If the icon has not been added yet
|
||||
if( !("[icon_state][target_dir]" in beam_master) )
|
||||
var/image/I = image(icon,icon_state,10,target_dir) //Generate it.
|
||||
beam_master["[icon_state][target_dir]"] = I //And cache it!
|
||||
|
||||
if(reference in beam_master)
|
||||
var/list/turf_master = beam_master[reference]
|
||||
//Finally add the overlay
|
||||
src.loc.overlays += beam_master["[icon_state][target_dir]"]
|
||||
|
||||
if("[icon_state][target_dir]" in turf_master)
|
||||
var/list/turfs = turf_master["[icon_state][target_dir]"]
|
||||
turfs += loc
|
||||
//Add the turf to a list in the beam master so they can be cleaned up easily.
|
||||
if(reference in beam_master)
|
||||
var/list/turf_master = beam_master[reference]
|
||||
if("[icon_state][target_dir]" in turf_master)
|
||||
var/list/turfs = turf_master["[icon_state][target_dir]"]
|
||||
turfs += loc
|
||||
else
|
||||
turf_master["[icon_state][target_dir]"] = list(loc)
|
||||
else
|
||||
turf_master["[icon_state][target_dir]"] = list(loc)
|
||||
var/list/turfs = list()
|
||||
turfs["[icon_state][target_dir]"] = list(loc)
|
||||
beam_master[reference] = turfs
|
||||
else
|
||||
var/list/turfs = new
|
||||
turfs["[icon_state][target_dir]"] = list(loc)
|
||||
beam_master[reference] = turfs
|
||||
|
||||
cleanup(reference)
|
||||
|
||||
/obj/item/projectile/beam/dumbfire(const/dir)
|
||||
if(!(dir in alldirs))
|
||||
returnToPool(src)
|
||||
first = 0
|
||||
cleanup(reference)
|
||||
return
|
||||
|
||||
var/reference = "\ref[src]"
|
||||
|
||||
/obj/item/projectile/beam/dumbfire(var/dir)
|
||||
spawn(0)
|
||||
var/nextLoc = locate(Clamp(x + xo, 1, world.maxx), Clamp(y + yo, 1, world.maxy), z)
|
||||
var/target_dir = dir
|
||||
var/reference = "\ref[src]" // So we do not have to recalculate it a ton.
|
||||
var/lastposition = loc
|
||||
var/target_dir = src.dir // TODO: remove dir arg.
|
||||
|
||||
while(src && --kill_count >= 0)
|
||||
while(loc) // Move until we hit something.
|
||||
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
|
||||
returnToPool(src)
|
||||
return
|
||||
break
|
||||
|
||||
if(loc == nextLoc)
|
||||
nextLoc = locate(Clamp(x + xo, 1, world.maxx), Clamp(y + yo, 1, world.maxy), z)
|
||||
step(src, target_dir) // Move.
|
||||
|
||||
step_towards(src, nextLoc, 0)
|
||||
if(isnull(loc))
|
||||
break
|
||||
|
||||
if(!("[icon_state][target_dir]" in beam_master))
|
||||
beam_master["[icon_state][target_dir]"] = image(icon, icon_state, 10, target_dir)
|
||||
if(lastposition == loc)
|
||||
kill_count = 0
|
||||
|
||||
lastposition = loc
|
||||
|
||||
if(kill_count < 1)
|
||||
returnToPool(src)
|
||||
break
|
||||
|
||||
kill_count--
|
||||
|
||||
// Add the overlay as we pass over tiles.
|
||||
|
||||
// If the icon has not been added yet.
|
||||
if(!("[icon_state][target_dir]" in beam_master) )
|
||||
beam_master["[icon_state][target_dir]"] = image(icon, icon_state, 10, target_dir) // Generate, and cache it!
|
||||
|
||||
// Finally add the overlay
|
||||
loc.overlays += beam_master["[icon_state][target_dir]"]
|
||||
|
||||
// Add the turf to a list in the beam master so they can be cleaned up easily.
|
||||
if(reference in beam_master)
|
||||
var/list/turf_master = beam_master[reference]
|
||||
|
||||
if("[icon_state][target_dir]" in turf_master)
|
||||
var/list/turfs = turf_master["[icon_state][target_dir]"]
|
||||
turfs += loc
|
||||
turf_master["[icon_state][target_dir]"] += loc
|
||||
else
|
||||
turf_master["[icon_state][target_dir]"] = list(loc)
|
||||
else
|
||||
@@ -264,24 +296,23 @@ var/list/beam_master = list()
|
||||
turfs["[icon_state][target_dir]"] = list(loc)
|
||||
beam_master[reference] = turfs
|
||||
|
||||
cleanup(reference)
|
||||
|
||||
/obj/item/projectile/beam/Destroy()
|
||||
// don't use qdel when deleting this, returnToPool will handle it.
|
||||
..()
|
||||
cleanup(reference)
|
||||
|
||||
/obj/item/projectile/beam/proc/cleanup(const/reference)
|
||||
spawn(3)
|
||||
src = null // Redundant.
|
||||
// No, if it's not set to null this proc will be silently killed.
|
||||
|
||||
spawn(3) // Waits .3 seconds then removes the overlay.
|
||||
var/list/turf_master = beam_master[reference]
|
||||
|
||||
for(var/laser_state in turf_master)
|
||||
var/list/turfs = turf_master[laser_state]
|
||||
|
||||
for(var/atom/A in turfs)
|
||||
A.overlays -= beam_master[laser_state]
|
||||
turfs -= A
|
||||
for(var/turf/T in turfs)
|
||||
T.overlays -= beam_master[laser_state]
|
||||
T = null
|
||||
|
||||
returnToPool(src)
|
||||
turfs.Cut()
|
||||
|
||||
/obj/item/projectile/beam/practice
|
||||
name = "laser"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
return 0
|
||||
|
||||
/obj/item/projectile/bullet/weakbullet
|
||||
icon_state = "bbshell"
|
||||
damage = 10
|
||||
stun = 5
|
||||
weaken = 5
|
||||
@@ -70,6 +71,7 @@
|
||||
|
||||
/obj/item/projectile/bullet/stunshot
|
||||
name = "stunshot"
|
||||
icon_state = "sshell"
|
||||
damage = 5
|
||||
stun = 10
|
||||
weaken = 10
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
|
||||
/obj/item/projectile/energy/dart
|
||||
name = "dart"
|
||||
name = "dshell"
|
||||
icon_state = "toxin"
|
||||
damage = 5
|
||||
damage_type = TOX
|
||||
|
||||
Reference in New Issue
Block a user