Skip to content

Commit

Permalink
TGS Test Merge (#7492)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Nov 21, 2024
2 parents 02c65db + 3202a57 commit 34179f9
Show file tree
Hide file tree
Showing 10 changed files with 248 additions and 3 deletions.
84 changes: 84 additions & 0 deletions code/datums/ammo/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,90 @@
var/obj/item/weapon/gun/flare/flare_gun_fired_from = fired_projectile.shot_from
flare_gun_fired_from.last_signal_flare_name = signal_flare.name

/datum/ammo/arrow
name = "arrow"
ping = null //no bounce off.
damage_type = BRUTE
icon_state = "arrow"

damage = 110
penetration = 20
accuracy = HIT_ACCURACY_TIER_3
max_range = 14
shell_speed = AMMO_SPEED_TIER_3
flags_ammo_behavior = AMMO_SPECIAL_EMBED
shrapnel_chance = SHRAPNEL_CHANCE_TIER_10
shrapnel_type = /obj/item/arrow
handful_type = /obj/item/arrow
sound_hit = 'sound/weapons/pierce.ogg'
var/activated = FALSE

/datum/ammo/arrow/on_embed(mob/embedded_mob, obj/limb/target_organ, silent = FALSE)
if(!ishumansynth_strict(embedded_mob) || !istype(target_organ))
return
target_organ.embed(new shrapnel_type)

/datum/ammo/arrow/proc/drop_arrow(turf/T, obj/projectile/fired_projectile)
var/obj/item/arrow/arrow = new handful_type(T)
var/matrix/rotation = matrix()
rotation.Turn(fired_projectile.angle - 90)
arrow.apply_transform(rotation)

/datum/ammo/arrow/on_hit_mob(mob/mob,obj/projectile/projectile)
mob.apply_effect(1, STUN)
mob.apply_effect(3, DAZE)
if(!ishumansynth_strict(mob))
drop_arrow(get_turf(mob), projectile)
pushback(mob, projectile, 7)

/datum/ammo/arrow/on_hit_obj(obj/object,obj/projectile/projectile)
drop_arrow(get_turf(projectile), projectile)

/datum/ammo/arrow/on_hit_turf(turf/turf, obj/projectile/projectile)
if(turf.density && isturf(projectile.loc))
drop_arrow(projectile.loc, projectile)
else
drop_arrow(turf, projectile)

/datum/ammo/arrow/do_at_max_range(obj/projectile/projectile, mob/firer)
drop_arrow(get_turf(projectile), projectile)

/datum/ammo/arrow/expl
activated = TRUE
handful_type = /obj/item/arrow/expl
damage_type = BURN
flags_ammo_behavior = AMMO_HITS_TARGET_TURF
shrapnel_chance = 0
var/datum/effect_system/smoke_spread/smoke

/datum/ammo/arrow/expl/New()
. = ..()
smoke = new()

/datum/ammo/arrow/expl/on_hit_mob(mob/mob,obj/projectile/projectile)
cell_explosion(get_turf(mob), 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data)
smoke.set_up(1, get_turf(mob))
smoke.start()

/datum/ammo/arrow/expl/on_hit_obj(obj/object,obj/projectile/projectile)
cell_explosion(get_turf(projectile), 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data)
smoke.set_up(1, get_turf(projectile))
smoke.start()
/datum/ammo/arrow/expl/on_hit_turf(turf/turf, obj/projectile/projectile)
if(turf.density && isturf(projectile.loc))
cell_explosion(get_turf(projectile), 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data)
smoke.set_up(1, get_turf(projectile))
smoke.start()
else
cell_explosion(turf, 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data)
smoke.set_up(1, turf)
smoke.start()

/datum/ammo/arrow/expl/do_at_max_range(obj/projectile/projectile, mob/firer)
cell_explosion(get_turf(projectile), 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data)
smoke.set_up(1, get_turf(projectile))
smoke.start()

/datum/ammo/flare/starshell
name = "starshell ash"
icon_state = "starshell_bullet"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ GLOBAL_LIST_INIT(cm_vending_equipment_yautja, list(
list("The Agile Drone", 0, /obj/item/falcon_drone, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),
list("The Purifying Smart-Disc", 0, /obj/item/explosive/grenade/spawnergrenade/smartdisc, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),
list("The Steadfast Shield", 0, /obj/item/weapon/shield/riot/yautja, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),
list("The Firm Bow", 0, /obj/item/storage/belt/gun/quiver/full, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),

list("Clothing Accessory (CHOOSE 1)", 0, null, null, null),
list("Third-Cape", 0, /obj/item/clothing/yautja_cape/third, MARINE_CAN_BUY_ACCESSORY, VENDOR_ITEM_REGULAR),
Expand Down Expand Up @@ -66,6 +67,7 @@ GLOBAL_LIST_INIT(cm_vending_elder_yautja, list(
list("The Agile Drone", 0, /obj/item/falcon_drone, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),
list("The Purifying Smart-Disc", 0, /obj/item/explosive/grenade/spawnergrenade/smartdisc, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),
list("The Steadfast Shield", 0, /obj/item/weapon/shield/riot/yautja, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),
list("The Firm Bow", 0, /obj/item/storage/belt/gun/quiver/full, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),

list("Clothing Accessory (CHOOSE 1)", 0, null, null, null),
list("Third-Cape", 0, /obj/item/clothing/yautja_cape/third, MARINE_CAN_BUY_ACCESSORY, VENDOR_ITEM_REGULAR),
Expand Down
159 changes: 159 additions & 0 deletions code/modules/cm_preds/yaut_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,165 @@
user.update_power_display(perc)
return TRUE

/obj/item/weapon/gun/bow
name = "hunting bow"
desc = "An abnormal-sized weapon with an exeptionally tight string. Requires extraordinary strength to draw."
icon = 'icons/obj/items/hunter/pred_gear.dmi'
icon_state = "bow"
item_state = "bow"
item_icons = list(
WEAR_L_HAND = 'icons/mob/humans/onmob/hunter/items_lefthand.dmi',
WEAR_R_HAND = 'icons/mob/humans/onmob/hunter/items_righthand.dmi'
)
current_mag = /obj/item/ammo_magazine/internal/bow
reload_sound = 'sound/weapons/gun_shotgun_shell_insert.ogg'
fire_sound = 'sound/weapons/bow_shot.ogg'
aim_slowdown = 0
flags_equip_slot = SLOT_BLOCK_SUIT_STORE
flags_gun_features = GUN_INTERNAL_MAG|GUN_CAN_POINTBLANK|GUN_WIELDED_FIRING_ONLY|GUN_UNUSUAL_DESIGN
gun_category = GUN_CATEGORY_HEAVY
muzzle_flash = null
w_class = SIZE_LARGE
explo_proof = TRUE
unacidable = TRUE
flags_item = TWOHANDED|ITEM_PREDATOR

/obj/item/weapon/gun/bow/Initialize(mapload, spawn_empty)
. = ..(mapload, TRUE) //is there a better way?
update_icon()

/obj/item/weapon/gun/bow/set_gun_config_values()
..()
set_fire_delay(FIRE_DELAY_TIER_7)
accuracy_mult = BASE_ACCURACY_MULT
scatter = 0
recoil = RECOIL_AMOUNT_TIER_4

/obj/item/weapon/gun/bow/reload_into_chamber(mob/user)
. = ..()
update_icon()

/obj/item/weapon/gun/bow/unload(mob/user)
if(!current_mag || !current_mag.current_rounds)
return
var/obj/item/arrow/unloaded_arrow = new ammo.handful_type(get_turf(src))
playsound(user, reload_sound, 25, TRUE)
current_mag.current_rounds--
if(user)
to_chat(user, SPAN_NOTICE("You unload [unloaded_arrow] from [src]."))
user.put_in_hands(unloaded_arrow)
update_icon()


/obj/item/weapon/gun/bow/update_icon()
..()
if (!current_mag || current_mag.current_rounds == 0 || !istype(ammo, /datum/ammo/arrow))
return
var/datum/ammo/arrow/arrow = ammo
if (arrow.activated)
icon_state = "bow_expl"
else
icon_state = "bow_loaded"

/obj/item/weapon/gun/bow/attackby(obj/item/attacking_item, mob/user)
if(!istype(attacking_item, /obj/item/arrow))
to_chat(user, SPAN_WARNING("That's not an arrow!"))
return
if(!current_mag || current_mag.current_rounds == 1)
return to_chat(user, SPAN_WARNING("[src] is already loaded!"))
var/obj/item/arrow/attacking_arrow = attacking_item
if (user.r_hand != src && user.l_hand != src)
to_chat(user, SPAN_WARNING("You need to hold [src] in your hand in order to nock [attacking_arrow]!"))
return
if (!isyautja(user))
to_chat(user, SPAN_WARNING("You're not nearly strong enough to pull back [src]'s drawstring!"))
return
ammo = GLOB.ammo_list[attacking_arrow.ammo_datum]
playsound(user, reload_sound, 25, 1)
to_chat(user, SPAN_NOTICE("You nock [attacking_arrow] onto [src]."))
current_mag.current_rounds++
qdel(attacking_arrow)
update_icon()

/obj/item/weapon/gun/bow/dropped(mob/user)
. = ..()
if(!current_mag || !current_mag.current_rounds)
return
to_chat(user, SPAN_WARNING("The projectile falls out of [src]!"))
unload()

/obj/item/weapon/gun/bow/click_empty(mob/user)
return

/obj/item/ammo_magazine/internal/bow
name = "bow internal magazine"
caliber = "arrow"
max_rounds = 1
default_ammo = /datum/ammo/arrow

/obj/item/arrow
name = "arrow"
w_class = SIZE_SMALL
icon = 'icons/obj/items/hunter/pred_gear.dmi'
icon_state = "arrow"
item_state = "arrow"
sharp = IS_SHARP_ITEM_ACCURATE
edge = TRUE
force = 20
explo_proof = TRUE
unacidable = TRUE

var/activated = FALSE
var/ammo_datum = /datum/ammo/arrow

/obj/item/arrow/expl
name = "\improper activated arrow"
activated = TRUE
icon_state = "arrow_expl"
ammo_datum = /datum/ammo/arrow/expl

/obj/item/arrow/attack_self(mob/user)
. = ..()
if (!isyautja(user))
to_chat(user, SPAN_NOTICE("You attempt to [activated ? "deactivate" : "activate"] [src], but nothing happens."))
return
if (activated)
activated = FALSE
icon_state = "arrow"
ammo_datum = /datum/ammo/arrow
to_chat(user, SPAN_NOTICE("You deactivate [src]."))
return
activated = TRUE
icon_state = "arrow_expl"
ammo_datum = /datum/ammo/arrow/expl
to_chat(user, SPAN_NOTICE("You activate [src]."))


/obj/item/storage/belt/gun/quiver
name = "quiver strap"
desc = "A strap that can hold a bow with a quiver for arrows."
storage_slots = 8
max_storage_space = 20
icon_state = "quiver"
item_state = "s_marinebelt"
flags_equip_slot = SLOT_WAIST|SLOT_SUIT_STORE
max_w_class = SIZE_LARGE
icon = 'icons/obj/items/hunter/pred_gear.dmi'
item_icons = list(
WEAR_WAIST = 'icons/mob/humans/onmob/hunter/pred_gear.dmi'
)
can_hold = list(
/obj/item/weapon/gun/bow,
/obj/item/arrow,
)
explo_proof = TRUE
unacidable = TRUE

/obj/item/storage/belt/gun/quiver/full/fill_preset_inventory()
handle_item_insertion(new /obj/item/weapon/gun/bow())
for(var/i = 1 to storage_slots - 1)
new /obj/item/arrow(src)

#undef FLAY_STAGE_SCALP
#undef FLAY_STAGE_STRIP
#undef FLAY_STAGE_SKIN
6 changes: 3 additions & 3 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ note dizziness decrements automatically in the mob's Life() proc.
return FALSE
to_chat(usr, SPAN_WARNING("You attempt to get a good grip on [selection] in [src]'s body."))

if(!do_after(usr, 80 * usr.get_skill_duration_multiplier(SKILL_SURGERY), INTERRUPT_ALL, BUSY_ICON_FRIENDLY))
if(!do_after(usr, 20 * selection.w_class * usr.get_skill_duration_multiplier(SKILL_SURGERY), INTERRUPT_ALL, BUSY_ICON_FRIENDLY))
return
if(!selection || !src || !usr || !istype(selection))
return
Expand Down Expand Up @@ -805,8 +805,8 @@ note dizziness decrements automatically in the mob's Life() proc.
affected.add_bleeding(I, TRUE)
affected.wounds += I
H.custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 1)

selection.forceMove(get_turf(src))
playsound(loc, 'sound/weapons/bladeslice.ogg', 25)
usr.put_in_hands(selection)
return TRUE

///Can this mob resist (default FALSE)
Expand Down
Binary file modified icons/mob/humans/onmob/hunter/items_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/humans/onmob/hunter/items_righthand.dmi
Binary file not shown.
Binary file modified icons/mob/humans/onmob/hunter/pred_gear.dmi
Binary file not shown.
Binary file modified icons/obj/items/hunter/pred_gear.dmi
Binary file not shown.
Binary file modified icons/obj/items/weapons/projectiles.dmi
Binary file not shown.
Binary file added sound/weapons/bow_shot.ogg
Binary file not shown.

0 comments on commit 34179f9

Please sign in to comment.