|
| 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 | + |
0 commit comments