mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-03 21:42:06 +00:00
156 lines
5.6 KiB
Plaintext
156 lines
5.6 KiB
Plaintext
/obj/item/shield
|
|
name = "shield"
|
|
block_chance = 50
|
|
armor = list("melee" = 50, "bullet" = 50, "laser" = 50, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 70)
|
|
|
|
/obj/item/shield/riot
|
|
name = "riot shield"
|
|
desc = "A shield adept at blocking blunt objects from connecting with the torso of the shield wielder."
|
|
icon = 'icons/obj/items_and_weapons.dmi'
|
|
icon_state = "riot"
|
|
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
|
|
slot_flags = ITEM_SLOT_BACK
|
|
force = 10
|
|
throwforce = 5
|
|
throw_speed = 2
|
|
throw_range = 3
|
|
w_class = WEIGHT_CLASS_BULKY
|
|
materials = list(MAT_GLASS=7500, MAT_METAL=1000)
|
|
attack_verb = list("shoved", "bashed")
|
|
var/cooldown = 0 //shield bash cooldown. based on world.time
|
|
|
|
|
|
/obj/item/shield/riot/attackby(obj/item/W, mob/user, params)
|
|
if(istype(W, /obj/item/melee/baton))
|
|
if(cooldown < world.time - 25)
|
|
user.visible_message("<span class='warning'>[user] bashes [src] with [W]!</span>")
|
|
playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1)
|
|
cooldown = world.time
|
|
else
|
|
return ..()
|
|
|
|
/obj/item/shield/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(attack_type == THROWN_PROJECTILE_ATTACK)
|
|
final_block_chance += 30
|
|
if(attack_type == LEAP_ATTACK)
|
|
final_block_chance = 100
|
|
return ..()
|
|
|
|
/obj/item/shield/riot/roman
|
|
name = "\improper Roman shield"
|
|
desc = "Bears an inscription on the inside: <i>\"Romanes venio domus\"</i>."
|
|
icon_state = "roman_shield"
|
|
item_state = "roman_shield"
|
|
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
|
|
|
|
/obj/item/shield/riot/roman/fake
|
|
desc = "Bears an inscription on the inside: <i>\"Romanes venio domus\"</i>. It appears to be a bit flimsy."
|
|
block_chance = 0
|
|
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0)
|
|
|
|
/obj/item/shield/riot/buckler
|
|
name = "wooden buckler"
|
|
desc = "A medieval wooden buckler."
|
|
icon_state = "buckler"
|
|
item_state = "buckler"
|
|
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
|
|
materials = list()
|
|
resistance_flags = FLAMMABLE
|
|
block_chance = 30
|
|
|
|
/obj/item/shield/energy
|
|
name = "energy combat shield"
|
|
desc = "A shield that reflects almost all energy projectiles, but is useless against physical attacks. It can be retracted, expanded, and stored anywhere."
|
|
icon = 'icons/obj/items_and_weapons.dmi'
|
|
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
|
|
w_class = WEIGHT_CLASS_TINY
|
|
attack_verb = list("shoved", "bashed")
|
|
throw_range = 5
|
|
force = 3
|
|
throwforce = 3
|
|
throw_speed = 3
|
|
var/base_icon_state = "eshield" // [base_icon_state]1 for expanded, [base_icon_state]0 for contracted
|
|
var/on_force = 10
|
|
var/on_throwforce = 8
|
|
var/on_throw_speed = 2
|
|
var/active = 0
|
|
var/clumsy_check = TRUE
|
|
|
|
/obj/item/shield/energy/Initialize()
|
|
. = ..()
|
|
icon_state = "[base_icon_state]0"
|
|
|
|
/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)
|
|
return 0
|
|
|
|
/obj/item/shield/energy/IsReflect()
|
|
return (active)
|
|
|
|
/obj/item/shield/energy/attack_self(mob/living/carbon/human/user)
|
|
if(clumsy_check && user.has_trait(TRAIT_CLUMSY) && prob(50))
|
|
to_chat(user, "<span class='warning'>You beat yourself in the head with [src].</span>")
|
|
user.take_bodypart_damage(5)
|
|
active = !active
|
|
icon_state = "[base_icon_state][active]"
|
|
|
|
if(active)
|
|
force = on_force
|
|
throwforce = on_throwforce
|
|
throw_speed = on_throw_speed
|
|
w_class = WEIGHT_CLASS_BULKY
|
|
playsound(user, 'sound/weapons/saberon.ogg', 35, 1)
|
|
to_chat(user, "<span class='notice'>[src] is now active.</span>")
|
|
else
|
|
force = initial(force)
|
|
throwforce = initial(throwforce)
|
|
throw_speed = initial(throw_speed)
|
|
w_class = WEIGHT_CLASS_TINY
|
|
playsound(user, 'sound/weapons/saberoff.ogg', 35, 1)
|
|
to_chat(user, "<span class='notice'>[src] can now be concealed.</span>")
|
|
add_fingerprint(user)
|
|
|
|
/obj/item/shield/riot/tele
|
|
name = "telescopic shield"
|
|
desc = "An advanced riot shield made of lightweight materials that collapses for easy storage."
|
|
icon = 'icons/obj/items_and_weapons.dmi'
|
|
icon_state = "teleriot0"
|
|
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
|
|
slot_flags = null
|
|
force = 3
|
|
throwforce = 3
|
|
throw_speed = 3
|
|
throw_range = 4
|
|
w_class = WEIGHT_CLASS_NORMAL
|
|
var/active = 0
|
|
|
|
/obj/item/shield/riot/tele/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(active)
|
|
return ..()
|
|
return 0
|
|
|
|
/obj/item/shield/riot/tele/attack_self(mob/living/user)
|
|
active = !active
|
|
icon_state = "teleriot[active]"
|
|
playsound(src.loc, 'sound/weapons/batonextend.ogg', 50, 1)
|
|
|
|
if(active)
|
|
force = 8
|
|
throwforce = 5
|
|
throw_speed = 2
|
|
w_class = WEIGHT_CLASS_BULKY
|
|
slot_flags = ITEM_SLOT_BACK
|
|
to_chat(user, "<span class='notice'>You extend \the [src].</span>")
|
|
else
|
|
force = 3
|
|
throwforce = 3
|
|
throw_speed = 3
|
|
w_class = WEIGHT_CLASS_NORMAL
|
|
slot_flags = null
|
|
to_chat(user, "<span class='notice'>[src] can now be concealed.</span>")
|
|
add_fingerprint(user)
|