/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:
kyunkyunkyun
2025-11-12 10:23:20 +00:00
committed by GitHub
parent e92a45369a
commit f96b26b75a
169 changed files with 858 additions and 851 deletions
+1 -1
View File
@@ -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))
+1 -1
View File
@@ -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 ..()
+3 -3
View File
@@ -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]")
+1 -1
View File
@@ -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>")