Skip to content

Commit 8d1c95a

Browse files
Loiosh42ThePooba
andauthored
Tutel - Tactical shield with integral shotgun loader (#4863)
* Yah * .dme time * Cargo stuff + icon fix ( I hope * Icon fix mayhaps * path change to avoid problems, plus more icon fix. * I forgor * Balancing. * Fix * AAAAAAAAAAAAAAAAAAH * Update tactical_shields.dm * Yargh (testing edition) * Nope, not that way * It will do for now * Update tactical_shields.dm * There, begone problems. * Guh * Update tactical_shields.dm * me coder code good strong --------- Co-authored-by: ThePooba <[email protected]>
1 parent 5a46132 commit 8d1c95a

File tree

9 files changed

+150
-6
lines changed

9 files changed

+150
-6
lines changed

code/modules/projectiles/boxes_magazines/_box_magazine.dm

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
var/list/bullet_cost
3636
///cost of the materials in the magazine/box itself
3737
var/list/base_cost
38+
///Whether the sprite updates if it has ammunition, monke var
39+
var/spriteshift = TRUE
3840

3941
/obj/item/ammo_box/Initialize(mapload)
4042
. = ..()
@@ -173,12 +175,13 @@
173175
desc = "[initial(desc)] There [(shells_left == 1) ? "is" : "are"] [shells_left] shell\s left!"
174176

175177
/obj/item/ammo_box/update_icon_state()
176-
var/shells_left = LAZYLEN(stored_ammo)
177-
switch(multiple_sprites)
178-
if(AMMO_BOX_PER_BULLET)
179-
icon_state = "[multiple_sprite_use_base ? base_icon_state : initial(icon_state)]-[shells_left]"
180-
if(AMMO_BOX_FULL_EMPTY)
181-
icon_state = "[multiple_sprite_use_base ? base_icon_state : initial(icon_state)]-[shells_left ? "full" : "empty"]"
178+
if(spriteshift == TRUE) ///this if loop is monke edit
179+
var/shells_left = LAZYLEN(stored_ammo)
180+
switch(multiple_sprites)
181+
if(AMMO_BOX_PER_BULLET)
182+
icon_state = "[multiple_sprite_use_base ? base_icon_state : initial(icon_state)]-[shells_left]"
183+
if(AMMO_BOX_FULL_EMPTY)
184+
icon_state = "[multiple_sprite_use_base ? base_icon_state : initial(icon_state)]-[shells_left ? "full" : "empty"]"
182185
return ..()
183186

184187
/// Updates the amount of material in this ammo box according to how many bullets are left in it.

icons/mob/clothing/back.dmi

-6.62 KB
Binary file not shown.
-249 Bytes
Binary file not shown.
-681 Bytes
Binary file not shown.

icons/obj/weapons/shields.dmi

1.13 KB
Binary file not shown.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
/// Tutel shield, designed to work with the Bobr
2+
/// Comes with a built-in 4 round ammobox to allow for easy reloading
3+
/// I based it off of ammo_box instead of shield because I believe ammo_box is more complicated
4+
5+
/obj/item/ammo_box/tacshield/tutel/
6+
name = "Tutel tactical buckler"
7+
desc = "A lightweight titanium-alloy shield. It has an integrated shotgun speedloader, allowing you to reload without putting down the shield."
8+
icon = 'icons/obj/weapons/shields.dmi'
9+
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
10+
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
11+
icon_state = "tutel"
12+
inhand_icon_state = "tutel"
13+
worn_icon_state = "ammobox"
14+
ammo_type = /obj/item/ammo_casing/shotgun
15+
max_ammo = 4
16+
caliber = CALIBER_SHOTGUN
17+
multitype = TRUE
18+
block_chance = 50
19+
max_integrity = 65 //breaks on the second slug block, survives the first
20+
slot_flags = ITEM_SLOT_BACK | ITEM_SLOT_BELT
21+
force = 15
22+
w_class = WEIGHT_CLASS_NORMAL
23+
attack_verb_continuous = list("shoves", "bashes")
24+
attack_verb_simple = list("shove", "bash")
25+
armor_type = /datum/armor/item_shield
26+
block_sound = 'sound/weapons/block_shield.ogg'
27+
start_empty = TRUE
28+
spriteshift = FALSE
29+
var/tutel_break_leftover = /obj/item/broken_shield
30+
31+
/obj/item/ammo_box/tacshield/tutel/examine(mob/user)
32+
. = ..()
33+
var/healthpercent = round((atom_integrity/max_integrity) * 100, 1)
34+
switch(healthpercent)
35+
if(50 to 99)
36+
. += span_info("It looks slightly damaged.")
37+
if(25 to 50)
38+
. += span_info("It appears heavily damaged.")
39+
if(0 to 25)
40+
. += span_warning("It's falling apart!")
41+
42+
/obj/item/ammo_box/tacshield/tutel/proc/shatter(mob/living/carbon/human/owner)
43+
playsound(owner, 'sound/effects/bang.ogg', 50)
44+
explosion(owner, 0, 0, 0, 0) //Shield breaking should be extremely obvious, and a little silly
45+
new tutel_break_leftover(get_turf(src))
46+
47+
48+
/obj/item/ammo_box/tacshield/tutel/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
49+
. = ..()
50+
if(.)
51+
if (atom_integrity <= damage)
52+
var/turf/owner_turf = get_turf(owner)
53+
owner_turf.visible_message(span_warning("[hitby] destroys [src]!"))
54+
shatter(owner)
55+
qdel(src)
56+
return TRUE
57+
take_damage(damage)
58+
return TRUE
59+
60+
/obj/item/ammo_box/tacshield/tutel/attackby(obj/item/attackby_item, mob/user, params)
61+
if(istype(attackby_item, /obj/item/stack/sheet/mineral/titanium))
62+
if (atom_integrity >= max_integrity)
63+
to_chat(user, span_warning("[src] is already in perfect condition."))
64+
return
65+
var/obj/item/stack/sheet/mineral/titanium/titanium_sheet = attackby_item
66+
titanium_sheet.use(1)
67+
atom_integrity = max_integrity
68+
to_chat(user, span_notice("You repair [src] with [titanium_sheet]."))
69+
return
70+
return ..()
71+
72+
/obj/item/broken_shield
73+
name = "broken Tutel"
74+
desc = "A broken tactical shield, it looks as though you could repair it with some titanium.."
75+
icon = 'icons/obj/weapons/shields.dmi'
76+
icon_state = "brokentutel"
77+
flags_1 = CONDUCT_1
78+
force = 5
79+
throwforce = 5
80+
w_class = WEIGHT_CLASS_NORMAL
81+
custom_materials = list(/datum/material/titanium = HALF_SHEET_MATERIAL_AMOUNT + SMALL_MATERIAL_AMOUNT * 3)
82+
attack_verb_continuous = list("hits", "bludgeons", "whacks", "bonks")
83+
attack_verb_simple = list("hit", "bludgeon", "whack", "bonk")
84+
85+
/obj/item/broken_shield/Initialize(mapload)
86+
. = ..()
87+
88+
var/static/list/hovering_item_typechecks = list(
89+
/obj/item/stack/sheet/mineral/titanium = list(
90+
SCREENTIP_CONTEXT_LMB = "Repair shield",
91+
),
92+
93+
)
94+
95+
AddElement(/datum/element/contextual_screentip_item_typechecks, hovering_item_typechecks)
96+
97+
/obj/item/broken_shield/attackby(obj/item/attacking_item, mob/user, params)
98+
if(istype(attacking_item, /obj/item/stack/sheet/mineral/titanium))
99+
var/datum/crafting_recipe/recipe_to_use = /datum/crafting_recipe/tutel
100+
user.balloon_alert(user, "repairing shield...")
101+
if(do_after(user, initial(recipe_to_use.time), src)) // we do initial work here to get the correct timer
102+
var/obj/item/ammo_box/tacshield/tutel/crafted_tutel = new /obj/item/ammo_box/tacshield/tutel/()
103+
104+
remove_item_from_storage(user)
105+
if (!user.transferItemToLoc(attacking_item, crafted_tutel))
106+
return
107+
crafted_tutel.CheckParts(list(attacking_item))
108+
qdel(src)
109+
110+
user.put_in_hands(crafted_tutel)
111+
user.balloon_alert(user, "repaired shield")
112+
return
113+
return ..()
114+
115+
/datum/crafting_recipe/tutel
116+
name = "Tutel Repair"
117+
result = /obj/item/ammo_box/tacshield/tutel/
118+
reqs = list(
119+
/obj/item/broken_shield = 1,
120+
/obj/item/stack/sheet/mineral/titanium = 1,
121+
)
122+
time = 5 SECONDS
123+
category = CAT_WEAPON_MELEE
124+

monkestation/code/modules/blueshift/armaments/nri.dm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@
7878
item_type = /obj/item/trench_tool
7979
cost = PAYCHECK_CREW
8080

81+
/datum/armament_entry/company_import/nri_surplus/misc/tutel
82+
item_type = /obj/item/ammo_box/tacshield/tutel/
83+
cost = PAYCHECK_CREW * 3
84+
8185
/datum/armament_entry/company_import/nri_surplus/firearm
8286
subcategory = "Firearms"
8387

monkestation/code/modules/blueshift/cargo/armory.dm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,15 @@
5252
/obj/item/gun/energy/modular_laser_rifle,
5353
)
5454
crate_name = "\improper Modular Laser Rifle Crate"
55+
56+
//monke from here down
57+
/datum/supply_pack/security/armory/bobr
58+
name = "Tactical Bóbr Crate"
59+
desc = "Two Bóbr shotgun revolvers, with matching Tutel ballistic shields and ammo for each."
60+
cost = CARGO_CRATE_VALUE * 20
61+
contains = list(
62+
/obj/item/gun/ballistic/revolver/shotgun_revolver = 2,
63+
/obj/item/ammo_box/tacshield/tutel/ = 2,
64+
/obj/item/ammo_box/advanced/s12gauge = 2,
65+
)
66+
crate_name = "Tactical Bóbr Crate"

tgstation.dme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6125,6 +6125,7 @@
61256125
#include "monkestation\code\game\objects\items\spraycan_gun.dm"
61266126
#include "monkestation\code\game\objects\items\stickers.dm"
61276127
#include "monkestation\code\game\objects\items\superglue.dm"
6128+
#include "monkestation\code\game\objects\items\tactical_shields.dm"
61286129
#include "monkestation\code\game\objects\items\translation_hat.dm"
61296130
#include "monkestation\code\game\objects\items\trash.dm"
61306131
#include "monkestation\code\game\objects\items\turf_demolisher.dm"

0 commit comments

Comments
 (0)