Files
CHOMPStation2/code/game/objects/structures/mirror.dm
unknown 39b467c9da New bullet types, projectile rewrite
* Refactors projectile Bump()
* Converts projectile_type var strings to paths
* Reorganizes bullet projectile paths
* Made a pass through all the bullet_act() definitions. Mainly ensured that damage_type is checked when dealing damage to certain objects. Removed stupid /turf bullet_act() override, replaced with on_hit() overrides on the relevant projectiles.

* Adds shotgun pellets projectile. Adds Raptor's shotgun slug sprite.
* Gives stunshots more of their own identity, refluffs them as taser cartridges for shotguns. They still aren't obtainable anywhere unless spawned.
* Makes projectiles pass through girders and cultgirders with a certain probability, unless the girder itself was clicked.
* Projectiles are also able to pass through grilles. Low damage projectiles have a chance to be blocked by grilles. High damage projectiles have a chance to have some damage absorbed by the grille.
* Makes projectiles for blanks invisible.
* Adds flash bullet types
* Adds support for 'penetrating' projectiles
* Swaps .45 and 9mm projectile types. .45s hit slightly harder, 9mils have more ammo capacity.
2015-02-06 20:09:32 -05:00

107 lines
3.1 KiB
Plaintext

//wip wip wup
/obj/structure/mirror
name = "mirror"
desc = "A SalonPro Nano-Mirror(TM) brand mirror! The leading technology in hair salon products, utilizing nano-machinery to style your hair just right."
icon = 'icons/obj/watercloset.dmi'
icon_state = "mirror"
density = 0
anchored = 1
var/shattered = 0
/obj/structure/mirror/attack_hand(mob/user as mob)
if(shattered) return
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.a_intent == "hurt")
if(prob(30) || H.species.can_shred(H))
attack_generic(user,1)
else
attack_generic(user)
return
var/userloc = H.loc
//see code/modules/mob/new_player/preferences.dm at approx line 545 for comments!
//this is largely copypasted from there.
//handle facial hair (if necessary)
if(H.gender == MALE)
var/list/species_facial_hair = list()
if(H.species)
for(var/i in facial_hair_styles_list)
var/datum/sprite_accessory/facial_hair/tmp_facial = facial_hair_styles_list[i]
if(H.species.name in tmp_facial.species_allowed)
species_facial_hair += i
else
species_facial_hair = facial_hair_styles_list
var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in species_facial_hair
if(userloc != H.loc) return //no tele-grooming
if(new_style)
H.f_style = new_style
//handle normal hair
var/list/species_hair = list()
if(H.species)
for(var/i in hair_styles_list)
var/datum/sprite_accessory/hair/tmp_hair = hair_styles_list[i]
if(H.species.name in tmp_hair.species_allowed)
species_hair += i
else
species_hair = hair_styles_list
var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in species_hair
if(userloc != H.loc) return //no tele-grooming
if(new_style)
H.h_style = new_style
H.update_hair()
/obj/structure/mirror/proc/shatter()
if(shattered) return
shattered = 1
icon_state = "mirror_broke"
playsound(src, "shatter", 70, 1)
desc = "Oh no, seven years of bad luck!"
/obj/structure/mirror/bullet_act(var/obj/item/projectile/Proj)
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
return
if(prob(Proj.damage * 2))
if(!shattered)
shatter()
else
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
..()
/obj/structure/mirror/attackby(obj/item/I as obj, mob/user as mob)
if(shattered)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
return
if(prob(I.force * 2))
visible_message("<span class='warning'>[user] smashes [src] with [I]!</span>")
shatter()
else
visible_message("<span class='warning'>[user] hits [src] with [I]!</span>")
playsound(src.loc, 'sound/effects/Glasshit.ogg', 70, 1)
/obj/structure/mirror/attack_generic(var/mob/user, var/damage)
if(shattered)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
return 0
if(damage)
user.visible_message("<span class='danger'>[user] smashes [src]!")
shatter()
else
user.visible_message("<span class='danger'>[user] hits [src] and bounces off!</span>")
return 1