mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
/obj/item/projectile --> /obj/projectile (#30411)
* yers * vars * map changes * some comments (clearly not stolen from items) * fix component * summary
This commit is contained in:
@@ -464,7 +464,7 @@
|
||||
var/turf/U = get_turf(target)
|
||||
if(!T || !U)
|
||||
return
|
||||
var/obj/item/projectile/temp/basilisk/O = new /obj/item/projectile/temp/basilisk(T)
|
||||
var/obj/projectile/temp/basilisk/O = new /obj/projectile/temp/basilisk(T)
|
||||
playsound(get_turf(src), 'sound/weapons/taser2.ogg', 75, TRUE)
|
||||
if(drops_core)
|
||||
O.stun = 0.5 SECONDS
|
||||
|
||||
@@ -129,8 +129,8 @@
|
||||
causes_coughing = TRUE
|
||||
|
||||
/obj/effect/particle_effect/smoke/bad/CanPass(atom/movable/mover, border_dir)
|
||||
if(istype(mover, /obj/item/projectile/beam))
|
||||
var/obj/item/projectile/beam/B = mover
|
||||
if(istype(mover, /obj/projectile/beam))
|
||||
var/obj/projectile/beam/B = mover
|
||||
B.damage = (B.damage / 2)
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
armor = list(MELEE = 100, BULLET = 100, LASER = 100, ENERGY = 100, BOMB = 100, RAD = 100, FIRE = 100, ACID = 100)
|
||||
|
||||
// Most of these overrides procs below are overkill, but better safe than sorry.
|
||||
/obj/effect/abstract/bullet_act(obj/item/projectile/P)
|
||||
/obj/effect/abstract/bullet_act(obj/projectile/P)
|
||||
return
|
||||
|
||||
/obj/effect/abstract/decompile_act(obj/item/matter_decompiler/C, mob/user)
|
||||
|
||||
@@ -286,10 +286,10 @@
|
||||
* Creates an explosion of shrapnel at a turf.
|
||||
* - /turf/epicenter - where the explosion occurs
|
||||
* - shrapnel_number - the amount of shrapnel to create
|
||||
* - /obj/item/projectile/shrapnel_type - the type of shrapnel bullets to shoot
|
||||
* - /obj/projectile/shrapnel_type - the type of shrapnel bullets to shoot
|
||||
* - chance_to_hit_same_turf - the probability to hit someone on the same turf, doubled for someone lying down
|
||||
*/
|
||||
/proc/create_shrapnel(turf/epicenter, shrapnel_number = 10, obj/item/projectile/shrapnel_type = /obj/item/projectile/bullet/shrapnel, chance_to_hit_same_turf = 50)
|
||||
/proc/create_shrapnel(turf/epicenter, shrapnel_number = 10, obj/projectile/shrapnel_type = /obj/projectile/bullet/shrapnel, chance_to_hit_same_turf = 50)
|
||||
epicenter = get_turf(epicenter)
|
||||
if(!epicenter || !shrapnel_number || !shrapnel_type)
|
||||
return
|
||||
@@ -306,7 +306,7 @@
|
||||
mob_lying_on_turf = M
|
||||
|
||||
for(var/i in 1 to shrapnel_number)
|
||||
var/obj/item/projectile/Shrapnel = new shrapnel_type(epicenter)
|
||||
var/obj/projectile/Shrapnel = new shrapnel_type(epicenter)
|
||||
|
||||
// You can't just stand over a shrapnel explosion to avoid it
|
||||
if(mob_standing_on_turf && prob(chance_to_hit_same_turf))
|
||||
|
||||
@@ -217,6 +217,8 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
|
||||
new path(src)
|
||||
if(isstorage(loc)) //marks all items in storage as being such
|
||||
in_storage = TRUE
|
||||
if(sharp)
|
||||
AddComponent(/datum/component/surgery_initiator)
|
||||
|
||||
/// This proc is used to add text for items with ABSTRACT flag after default examine text.
|
||||
/obj/item/proc/customised_abstract_text(mob/living/carbon/owner)
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
if(prob(I.force))
|
||||
push_over()
|
||||
|
||||
/obj/item/cardboard_cutout/bullet_act(obj/item/projectile/P)
|
||||
/obj/item/cardboard_cutout/bullet_act(obj/projectile/P)
|
||||
visible_message("<span class='danger'>[src] is hit by [P]!</span>")
|
||||
playsound(src, 'sound/weapons/slice.ogg', 50, 1)
|
||||
if(prob(P.damage))
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
if(prob(50))
|
||||
qdel(src)
|
||||
|
||||
/obj/item/latexballon/bullet_act(obj/item/projectile/P)
|
||||
/obj/item/latexballon/bullet_act(obj/projectile/P)
|
||||
if(!P.nodamage)
|
||||
burst()
|
||||
return ..()
|
||||
|
||||
@@ -78,11 +78,11 @@
|
||||
#define DECALTYPE_SCORCH 1
|
||||
#define DECALTYPE_BULLET 2
|
||||
|
||||
/obj/item/target/bullet_act(obj/item/projectile/P)
|
||||
/obj/item/target/bullet_act(obj/projectile/P)
|
||||
var/p_x = P.p_x + pick(0,0,0,0,0,-1,1) // really ugly way of coding "sometimes offset P.p_x!"
|
||||
var/p_y = P.p_y + pick(0,0,0,0,0,-1,1)
|
||||
var/decaltype = DECALTYPE_SCORCH
|
||||
if(istype(P, /obj/item/projectile/bullet))
|
||||
if(istype(P, /obj/projectile/bullet))
|
||||
decaltype = DECALTYPE_BULLET
|
||||
|
||||
var/icon/C = icon(icon, icon_state)
|
||||
@@ -96,7 +96,7 @@
|
||||
bullet_hole.pixel_x = p_x - 1 //offset correction
|
||||
bullet_hole.pixel_y = p_y - 1
|
||||
if(decaltype == DECALTYPE_SCORCH)
|
||||
if(P.damage >= 20 || istype(P, /obj/item/projectile/beam/practice))
|
||||
if(P.damage >= 20 || istype(P, /obj/projectile/beam/practice))
|
||||
bullet_hole.dir = pick(NORTH,SOUTH,EAST,WEST) // random scorch design. light_scorch does not have different directions
|
||||
else
|
||||
bullet_hole.icon_state = "light_scorch"
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
/obj/item/gun/projectile/c_foam_launcher/update_icon_state()
|
||||
icon_state = "c_foam_launcher[magazine ? "_loaded" : ""]"
|
||||
|
||||
/obj/item/projectile/c_foam
|
||||
/obj/projectile/c_foam
|
||||
name = "blob of foam"
|
||||
icon_state = "foam_blob"
|
||||
damage = 0
|
||||
|
||||
/obj/item/projectile/c_foam/on_hit(atom/target, blocked, hit_zone)
|
||||
/obj/projectile/c_foam/on_hit(atom/target, blocked, hit_zone)
|
||||
. = ..()
|
||||
if(isairlock(target))
|
||||
var/obj/machinery/door/airlock = target
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
TED.pass_mind(M)
|
||||
|
||||
|
||||
/obj/item/projectile/energy/chrono_beam
|
||||
/obj/projectile/energy/chrono_beam
|
||||
name = "eradication beam"
|
||||
icon_state = "chronobolt"
|
||||
range = CHRONO_BEAM_RANGE
|
||||
@@ -125,21 +125,21 @@
|
||||
nodamage = 1
|
||||
var/obj/item/gun/energy/chrono_gun/gun = null
|
||||
|
||||
/obj/item/projectile/energy/chrono_beam/fire()
|
||||
/obj/projectile/energy/chrono_beam/fire()
|
||||
gun = firer.get_active_hand()
|
||||
if(istype(gun))
|
||||
return ..()
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/item/projectile/energy/chrono_beam/on_hit(atom/target)
|
||||
/obj/projectile/energy/chrono_beam/on_hit(atom/target)
|
||||
if(target && gun && isliving(target))
|
||||
var/obj/structure/chrono_field/F = new(target.loc, target, gun)
|
||||
gun.field_connect(F)
|
||||
|
||||
/obj/item/ammo_casing/energy/chrono_beam
|
||||
name = "eradication beam"
|
||||
projectile_type = /obj/item/projectile/energy/chrono_beam
|
||||
projectile_type = /obj/projectile/energy/chrono_beam
|
||||
muzzle_flash_color = null
|
||||
icon = 'icons/obj/projectiles.dmi'
|
||||
icon_state = "chronobolt"
|
||||
@@ -228,9 +228,9 @@
|
||||
qdel(src)
|
||||
|
||||
|
||||
/obj/structure/chrono_field/bullet_act(obj/item/projectile/P)
|
||||
if(istype(P, /obj/item/projectile/energy/chrono_beam))
|
||||
var/obj/item/projectile/energy/chrono_beam/beam = P
|
||||
/obj/structure/chrono_field/bullet_act(obj/projectile/P)
|
||||
if(istype(P, /obj/projectile/energy/chrono_beam))
|
||||
var/obj/projectile/energy/chrono_beam/beam = P
|
||||
var/obj/item/gun/energy/chrono_gun/Pgun = beam.gun
|
||||
if(Pgun && istype(Pgun))
|
||||
Pgun.field_connect(src)
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
create_with_tank = TRUE
|
||||
|
||||
/obj/item/flamethrower/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
||||
var/obj/item/projectile/P = hitby
|
||||
var/obj/projectile/P = hitby
|
||||
if(damage && attack_type == PROJECTILE_ATTACK && P.damage_type != STAMINA && prob(15))
|
||||
owner.visible_message("<span class='danger'>[attack_text] hits the fueltank on [owner]'s [src], rupturing it! What a shot!</span>")
|
||||
var/turf/target_turf = get_turf(owner)
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
prime()
|
||||
|
||||
/obj/item/grenade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
||||
var/obj/item/projectile/P = hitby
|
||||
var/obj/projectile/P = hitby
|
||||
if(damage && attack_type == PROJECTILE_ATTACK && P.damage_type != STAMINA && prob(15))
|
||||
owner.visible_message("<span class='userdanger'>[hitby] hits [owner]'s [name], setting it off! What a shot!</span>")
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// How much shrapnel the grenade will launch.
|
||||
var/shrapnel_contained = 20
|
||||
/// The type of projectile that will fired.
|
||||
var/embedded_type = /obj/item/projectile/bullet/shrapnel
|
||||
var/embedded_type = /obj/projectile/bullet/shrapnel
|
||||
|
||||
/obj/item/grenade/frag/prime()
|
||||
update_mob()
|
||||
@@ -22,7 +22,7 @@
|
||||
icon_state = "stinger"
|
||||
modifiable_timer = FALSE
|
||||
shrapnel_contained = 50
|
||||
embedded_type = /obj/item/projectile/bullet/pellet/rubber/stinger
|
||||
embedded_type = /obj/projectile/bullet/pellet/rubber/stinger
|
||||
|
||||
/obj/item/grenade/frag/stinger/prime()
|
||||
update_mob()
|
||||
@@ -33,7 +33,7 @@
|
||||
/**
|
||||
* Shrapnel that flies through the air and hits you
|
||||
*/
|
||||
/obj/item/projectile/bullet/shrapnel
|
||||
/obj/projectile/bullet/shrapnel
|
||||
name = "shrapnel"
|
||||
icon_state = "magspear"
|
||||
gender = PLURAL
|
||||
@@ -42,7 +42,7 @@
|
||||
var/embed_prob = 100 //reduced by armor
|
||||
var/embedded_type = /obj/item/shrapnel
|
||||
|
||||
/obj/item/projectile/bullet/shrapnel/on_hit(atom/target, blocked)
|
||||
/obj/projectile/bullet/shrapnel/on_hit(atom/target, blocked)
|
||||
. = ..()
|
||||
var/obj/item/new_possible_embed = new embedded_type(get_turf(src)) // drop it on the floor if we hit somethig non-living
|
||||
if(!.)
|
||||
@@ -56,7 +56,7 @@
|
||||
return
|
||||
human.try_embed_object(new_possible_embed)
|
||||
|
||||
/obj/item/projectile/bullet/shrapnel/on_range()
|
||||
/obj/projectile/bullet/shrapnel/on_range()
|
||||
var/obj/item/we_missed = new embedded_type(get_turf(src)) // we missed, lets toss the shrapnel
|
||||
var/range = gaussian(4, 2)
|
||||
if(range > 0)
|
||||
|
||||
@@ -311,7 +311,7 @@
|
||||
if(!.) // they did not block the attack
|
||||
return
|
||||
if(isprojectile(hitby))
|
||||
var/obj/item/projectile/P = hitby
|
||||
var/obj/projectile/P = hitby
|
||||
if(P.reflectability == REFLECTABILITY_ENERGY)
|
||||
owner.visible_message("<span class='danger'>[owner] parries [attack_text] with [src]!</span>")
|
||||
add_attack_logs(P.firer, src, "hit by [P.type] but got parried by [src]")
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
/obj/item/shield/energy/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
||||
if(isprojectile(hitby))
|
||||
var/obj/item/projectile/P = hitby
|
||||
var/obj/projectile/P = hitby
|
||||
if(P.shield_buster && active)
|
||||
toggle(owner, TRUE)
|
||||
to_chat(owner, "<span class='warning'>[hitby] overloaded your [src]!</span>")
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
if(3)
|
||||
take_damage(rand(10, 90), BRUTE, BOMB, 0)
|
||||
|
||||
/obj/bullet_act(obj/item/projectile/P)
|
||||
/obj/bullet_act(obj/projectile/P)
|
||||
. = ..()
|
||||
playsound(src, P.hitsound, 50, TRUE)
|
||||
visible_message("<span class='danger'>[src] is hit by \a [P]!</span>")
|
||||
|
||||
@@ -60,8 +60,6 @@
|
||||
armor = getArmor()
|
||||
else if(!istype(armor, /datum/armor))
|
||||
stack_trace("Invalid type [armor.type] found in .armor during /obj Initialize()")
|
||||
if(sharp)
|
||||
AddComponent(/datum/component/surgery_initiator)
|
||||
|
||||
if(obj_integrity == null)
|
||||
obj_integrity = max_integrity
|
||||
@@ -296,7 +294,7 @@
|
||||
C.take_organ_damage(damage)
|
||||
C.KnockDown(3 SECONDS)
|
||||
|
||||
/obj/handle_ricochet(obj/item/projectile/P)
|
||||
/obj/handle_ricochet(obj/projectile/P)
|
||||
. = ..()
|
||||
if(. && receive_ricochet_damage_coeff)
|
||||
// pass along receive_ricochet_damage_coeff damage to the structure for the ricochet
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
igniting = FALSE
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/structure/closet/coffin/vampire/bullet_act(obj/item/projectile/P)
|
||||
/obj/structure/closet/coffin/vampire/bullet_act(obj/projectile/P)
|
||||
if(!P.immolate)
|
||||
return ..()
|
||||
fire_act()
|
||||
|
||||
@@ -106,11 +106,11 @@
|
||||
max_integrity = 10
|
||||
allow_walk = FALSE
|
||||
|
||||
/obj/structure/holosign/barrier/cyborg/bullet_act(obj/item/projectile/P)
|
||||
/obj/structure/holosign/barrier/cyborg/bullet_act(obj/projectile/P)
|
||||
take_damage((P.damage / 5) , BRUTE, MELEE, 1) //Doesn't really matter what damage flag it is.
|
||||
if(istype(P, /obj/item/projectile/energy/electrode))
|
||||
if(istype(P, /obj/projectile/energy/electrode))
|
||||
take_damage(10, BRUTE, MELEE, 1) //Tasers aren't harmful.
|
||||
if(istype(P, /obj/item/projectile/beam/disabler))
|
||||
if(istype(P, /obj/projectile/beam/disabler))
|
||||
take_damage(5, BRUTE, MELEE, 1) //Disablers aren't harmful.
|
||||
|
||||
/obj/structure/holosign/barrier/cyborg/hacked
|
||||
@@ -119,7 +119,7 @@
|
||||
max_integrity = 20
|
||||
var/shockcd = 0
|
||||
|
||||
/obj/structure/holosign/barrier/cyborg/hacked/bullet_act(obj/item/projectile/P)
|
||||
/obj/structure/holosign/barrier/cyborg/hacked/bullet_act(obj/projectile/P)
|
||||
take_damage(P.damage, BRUTE, MELEE, 1) //Yeah no this doesn't get projectile resistance.
|
||||
|
||||
/obj/structure/holosign/barrier/cyborg/hacked/proc/cooldown()
|
||||
|
||||
@@ -47,7 +47,7 @@ GLOBAL_LIST_EMPTY(tendrils)
|
||||
. = ..()
|
||||
SEND_SIGNAL(src, COMSIG_SPAWNER_SET_TARGET, user)
|
||||
|
||||
/obj/structure/spawner/lavaland/bullet_act(obj/item/projectile/P)
|
||||
/obj/structure/spawner/lavaland/bullet_act(obj/projectile/P)
|
||||
. = ..()
|
||||
if(P.firer)
|
||||
SEND_SIGNAL(src, COMSIG_SPAWNER_SET_TARGET, P.firer)
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
if(mapload)
|
||||
anchored = TRUE
|
||||
|
||||
/obj/structure/reflector/bullet_act(obj/item/projectile/P)
|
||||
/obj/structure/reflector/bullet_act(obj/projectile/P)
|
||||
var/turf/reflector_turf = get_turf(src)
|
||||
var/turf/reflect_turf
|
||||
if(!istype(P, /obj/item/projectile/beam))
|
||||
if(!istype(P, /obj/projectile/beam))
|
||||
return ..()
|
||||
var/new_dir = get_reflection(dir, P.dir)
|
||||
if(new_dir && anchored)
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
if(exposed_temperature > 300)
|
||||
PlasmaBurn(exposed_temperature)
|
||||
|
||||
/obj/structure/statue/plasma/bullet_act(obj/item/projectile/P)
|
||||
/obj/structure/statue/plasma/bullet_act(obj/projectile/P)
|
||||
if(!QDELETED(src)) //wasn't deleted by the projectile's effects.
|
||||
if(!P.nodamage && ((P.damage_type == BURN) || (P.damage_type == BRUTE)))
|
||||
if(P.firer)
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/table/CanPass(atom/movable/mover, border_dir)
|
||||
if(istype(mover,/obj/item/projectile))
|
||||
if(istype(mover,/obj/projectile))
|
||||
return check_cover(mover, border_dir)
|
||||
|
||||
var/mob/living/living_mover = mover
|
||||
@@ -163,7 +163,7 @@
|
||||
* * P - The projectile trying to cross.
|
||||
* * proj_dir - The incoming direction of the projectile.
|
||||
*/
|
||||
/obj/structure/table/proc/check_cover(obj/item/projectile/P, proj_dir)
|
||||
/obj/structure/table/proc/check_cover(obj/projectile/P, proj_dir)
|
||||
. = TRUE
|
||||
if(!flipped)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user