mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
Removed the icon color blend operations from human's update_icons().
Changed all the hair/facial_hair/eye sprites to use a white base. Changed the preview screen, in the preference menu, to use ICON_MULTIPLY to be able to use the new white sprites. Removed the unused and broken cloaking item. Ninjas now use the alpha variable, removed most of the checks for it. Updated the documentation a bit. Added some helper procs for later.
This commit is contained in:
@@ -30,6 +30,11 @@
|
||||
else return default
|
||||
return default
|
||||
|
||||
/proc/unsanitize_hexcolor(color)
|
||||
. = ""
|
||||
for(var/i = 1; i <= length(color); i++)
|
||||
. += text("[copytext(color, i, i + 1)]0")
|
||||
return .
|
||||
|
||||
/proc/sanitize_hexcolor(color, desired_format=3, include_crunch=0, default)
|
||||
var/crunch = include_crunch ? "#" : ""
|
||||
|
||||
@@ -305,6 +305,9 @@ var/list/binary = list("0","1")
|
||||
/proc/random_short_color()
|
||||
return random_string(3, hex_characters)
|
||||
|
||||
/proc/random_color()
|
||||
return random_string(6, hex_characters)
|
||||
|
||||
/proc/add_zero2(t, u)
|
||||
var/temp1
|
||||
while (length(t) < u)
|
||||
|
||||
@@ -159,11 +159,6 @@
|
||||
del(animation)
|
||||
|
||||
for(var/mob/living/carbon/M in oviewers(3, null))
|
||||
if(prob(50))
|
||||
if (locate(/obj/item/weapon/cloaking_device, M))
|
||||
for(var/obj/item/weapon/cloaking_device/S in M)
|
||||
S.active = 0
|
||||
S.icon_state = "shield0"
|
||||
var/safety = M:eyecheck()
|
||||
if(!safety)
|
||||
if(!M.blinded)
|
||||
|
||||
@@ -22,12 +22,11 @@
|
||||
B.update_icon()
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/grenade/flashbang/proc/bang(var/turf/T , var/mob/living/carbon/M) // Added a new proc called 'bang' that takes a location and a person to be banged.
|
||||
if (locate(/obj/item/weapon/cloaking_device, M)) // Called during the loop that bangs people in lockers/containers and when banging
|
||||
for(var/obj/item/weapon/cloaking_device/S in M) // people in normal view. Could theroetically be called during other explosions.
|
||||
S.active = 0 // -- Polymorph
|
||||
S.icon_state = "shield0"
|
||||
|
||||
/obj/item/weapon/grenade/flashbang/proc/bang(var/turf/T , var/mob/living/carbon/M)
|
||||
// Added a new proc called 'bang' that takes a location and a person to be banged.
|
||||
// Called during the loop that bangs people in lockers/containers and when banging
|
||||
// people in normal view. Could theroetically be called during other explosions.
|
||||
// -- Polymorph
|
||||
M << "\red <B>BANG</B>"
|
||||
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
|
||||
|
||||
|
||||
@@ -74,40 +74,4 @@
|
||||
playsound(user, 'sound/weapons/saberoff.ogg', 50, 1)
|
||||
user << "<span class='notice'>[src] can now be concealed.</span>"
|
||||
reflect_chance = 0
|
||||
add_fingerprint(user)
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/cloaking_device
|
||||
name = "cloaking device"
|
||||
desc = "Use this to become invisible to the human eyesocket."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "shield0"
|
||||
var/active = 0.0
|
||||
flags = CONDUCT
|
||||
item_state = "electronic"
|
||||
throwforce = 10.0
|
||||
throw_speed = 2
|
||||
throw_range = 10
|
||||
w_class = 2.0
|
||||
origin_tech = "magnets=3;syndicate=4"
|
||||
|
||||
|
||||
/obj/item/weapon/cloaking_device/attack_self(mob/user as mob)
|
||||
src.active = !( src.active )
|
||||
if (src.active)
|
||||
user << "\blue The cloaking device is now active."
|
||||
src.icon_state = "shield1"
|
||||
else
|
||||
user << "\blue The cloaking device is now inactive."
|
||||
src.icon_state = "shield0"
|
||||
src.add_fingerprint(user)
|
||||
user.update_icons()
|
||||
return
|
||||
|
||||
/obj/item/weapon/cloaking_device/emp_act(severity)
|
||||
active = 0
|
||||
icon_state = "shield0"
|
||||
if(ismob(loc))
|
||||
loc:update_icons()
|
||||
..()
|
||||
add_fingerprint(user)
|
||||
@@ -689,8 +689,6 @@ var/global/list/g_fancy_list_of_safe_types = null
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(M), slot_glasses)
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(M), slot_head)
|
||||
|
||||
M.equip_to_slot_or_del(new /obj/item/weapon/cloaking_device(M), slot_r_store)
|
||||
|
||||
M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile(M), slot_r_hand)
|
||||
M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_l_store)
|
||||
|
||||
@@ -800,7 +798,6 @@ var/global/list/g_fancy_list_of_safe_types = null
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_glasses)
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/suit/wcoat(M), slot_wear_suit)
|
||||
M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword(M), slot_l_store)
|
||||
M.equip_to_slot_or_del(new /obj/item/weapon/cloaking_device(M), slot_r_store)
|
||||
|
||||
var/obj/item/weapon/storage/secure/briefcase/sec_briefcase = new(M)
|
||||
for(var/obj/item/briefcase_item in sec_briefcase)
|
||||
|
||||
@@ -2207,7 +2207,7 @@ ________________________________________________________________________________
|
||||
spawn(0)
|
||||
anim(U.loc,U,'icons/mob/mob.dmi',,"cloak",,U.dir)
|
||||
s_active=!s_active
|
||||
U.update_icons() //update their icons
|
||||
U.alpha = 0
|
||||
U << "\blue You are now invisible to normal detection."
|
||||
for(var/mob/O in oviewers(U))
|
||||
O.show_message("[U.name] vanishes into thin air!",1)
|
||||
@@ -2219,7 +2219,7 @@ ________________________________________________________________________________
|
||||
spawn(0)
|
||||
anim(U.loc,U,'icons/mob/mob.dmi',,"uncloak",,U.dir)
|
||||
s_active=!s_active
|
||||
U.update_icons() //update their icons
|
||||
U.alpha = 255
|
||||
U << "\blue You are now visible."
|
||||
for(var/mob/O in oviewers(U))
|
||||
O.show_message("[U.name] appears from thin air!",1)
|
||||
|
||||
@@ -118,8 +118,7 @@ Please contact me on #coderbus IRC. ~Carnie x
|
||||
overlays_standing[cache_index] = null
|
||||
|
||||
//UPDATES OVERLAYS FROM OVERLAYS_LYING/OVERLAYS_STANDING
|
||||
//this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers
|
||||
//I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date.
|
||||
|
||||
/mob/living/carbon/human/update_icons()
|
||||
lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again
|
||||
update_hud() //TODO: remove the need for this
|
||||
@@ -130,25 +129,9 @@ Please contact me on #coderbus IRC. ~Carnie x
|
||||
for(var/thing in overlays_lying)
|
||||
if(thing) overlays += thing
|
||||
else
|
||||
var/stealth = 0
|
||||
if(istype(wear_suit, /obj/item/clothing/suit/space/space_ninja) && wear_suit:s_active)
|
||||
stealth = 1
|
||||
else
|
||||
//cloaking devices. //TODO: get rid of this :<
|
||||
for(var/obj/item/weapon/cloaking_device/S in list(l_hand,r_hand,belt,l_store,r_store))
|
||||
if(S.active)
|
||||
stealth = 1
|
||||
break
|
||||
if(stealth)
|
||||
icon_state = "body_cloaked"
|
||||
if(overlays_standing[L_HAND_LAYER])
|
||||
overlays += overlays_standing[L_HAND_LAYER]
|
||||
if(overlays_standing[R_HAND_LAYER])
|
||||
overlays += overlays_standing[R_HAND_LAYER]
|
||||
else
|
||||
icon_state = "[base_icon_state]_s"
|
||||
for(var/thing in overlays_standing)
|
||||
if(thing) overlays += thing
|
||||
icon_state = "[base_icon_state]_s"
|
||||
for(var/thing in overlays_standing)
|
||||
if(thing) overlays += thing
|
||||
|
||||
|
||||
|
||||
@@ -192,10 +175,16 @@ Please contact me on #coderbus IRC. ~Carnie x
|
||||
if(S)
|
||||
var/icon/facial_s = icon("icon"=S.icon, "icon_state"="[S.icon_state]_s")
|
||||
var/icon/facial_l = icon("icon"=S.icon, "icon_state"="[S.icon_state]_l")
|
||||
facial_s.Blend("#[facial_hair_color]", ICON_ADD)
|
||||
facial_l.Blend("#[facial_hair_color]", ICON_ADD)
|
||||
standing += image("icon"=facial_s, "layer"=-HAIR_LAYER)
|
||||
lying += image("icon"=facial_l, "layer"=-HAIR_LAYER)
|
||||
|
||||
var/image/img_facial_s = image("icon"=facial_s, "layer"=-HAIR_LAYER)
|
||||
var/image/img_facial_l = image("icon"=facial_l, "layer"=-HAIR_LAYER)
|
||||
|
||||
var/new_color = "#" + unsanitize_hexcolor(facial_hair_color)
|
||||
img_facial_l.color = new_color
|
||||
img_facial_s.color = new_color
|
||||
|
||||
standing += img_facial_s
|
||||
lying += img_facial_l
|
||||
|
||||
//Applies the debrained overlay if there is no brain
|
||||
if(!getorgan(/obj/item/organ/brain))
|
||||
@@ -206,10 +195,16 @@ Please contact me on #coderbus IRC. ~Carnie x
|
||||
if(S)
|
||||
var/icon/hair_s = icon("icon"=S.icon, "icon_state"="[S.icon_state]_s")
|
||||
var/icon/hair_l = icon("icon"=S.icon, "icon_state"="[S.icon_state]_l")
|
||||
hair_s.Blend("#[hair_color]", ICON_ADD)
|
||||
hair_l.Blend("#[hair_color]", ICON_ADD)
|
||||
standing += image("icon"=hair_s, "layer"=-HAIR_LAYER)
|
||||
lying += image("icon"=hair_l, "layer"=-HAIR_LAYER)
|
||||
|
||||
var/image/img_hair_s = image("icon"=hair_s, "layer"=-HAIR_LAYER)
|
||||
var/image/img_hair_l = image("icon"=hair_l, "layer"=-HAIR_LAYER)
|
||||
|
||||
var/new_color = "#" + unsanitize_hexcolor(hair_color)
|
||||
img_hair_s.color = new_color
|
||||
img_hair_l.color = new_color
|
||||
|
||||
standing += img_hair_s
|
||||
lying += img_hair_l
|
||||
|
||||
if(lying.len)
|
||||
overlays_lying[HAIR_LAYER] = lying
|
||||
@@ -266,10 +261,17 @@ Please contact me on #coderbus IRC. ~Carnie x
|
||||
if(!dna || dna.mutantrace != "skeleton")
|
||||
var/icon/eyes_s = icon('icons/mob/human_face.dmi', "eyes_s")
|
||||
var/icon/eyes_l = icon('icons/mob/human_face.dmi', "eyes_l")
|
||||
eyes_s.Blend("#[eye_color]", ICON_ADD)
|
||||
eyes_l.Blend("#[eye_color]", ICON_ADD)
|
||||
standing += image("icon"=eyes_s, "layer"=-BODY_LAYER)
|
||||
lying += image("icon"=eyes_l, "layer"=-BODY_LAYER)
|
||||
|
||||
var/image/img_eyes_s = image("icon"=eyes_s, "layer"=-BODY_LAYER)
|
||||
var/image/img_eyes_l = image("icon"=eyes_l, "layer"=-BODY_LAYER)
|
||||
|
||||
var/new_color = "#" + unsanitize_hexcolor(eye_color)
|
||||
|
||||
img_eyes_s.color = new_color
|
||||
img_eyes_l.color = new_color
|
||||
|
||||
standing += img_eyes_s
|
||||
lying += img_eyes_l
|
||||
|
||||
//Underwear
|
||||
if(underwear)
|
||||
|
||||
@@ -18,13 +18,6 @@
|
||||
|
||||
|
||||
/mob/living/bullet_act(obj/item/projectile/P, def_zone)
|
||||
var/obj/item/weapon/cloaking_device/C = locate((/obj/item/weapon/cloaking_device) in src)
|
||||
if(C && C.active)
|
||||
C.attack_self(src)//Should shut it off
|
||||
update_icons()
|
||||
src << "<span class='notice'>Your [C] was disrupted!</span>"
|
||||
Stun(2)
|
||||
|
||||
var/armor = run_armor_check(def_zone, P.flag)
|
||||
if(!P.nodamage)
|
||||
apply_damage(P.damage, P.damage_type, def_zone, armor)
|
||||
|
||||
@@ -32,18 +32,18 @@ datum/preferences
|
||||
preview_icon.Blend(new /icon(S.icon, "[S.icon_state]_s"), ICON_OVERLAY)
|
||||
|
||||
var/icon/eyes_s = new/icon("icon" = 'icons/mob/human_face.dmi', "icon_state" = "eyes_s")
|
||||
eyes_s.Blend("#[eye_color]", ICON_ADD)
|
||||
eyes_s.Blend("#[eye_color]", ICON_MULTIPLY)
|
||||
|
||||
S = hair_styles_list[hair_style]
|
||||
if(S)
|
||||
var/icon/hair_s = new/icon("icon" = S.icon, "icon_state" = "[S.icon_state]_s")
|
||||
hair_s.Blend("#[hair_color]", ICON_ADD)
|
||||
hair_s.Blend("#[hair_color]", ICON_MULTIPLY)
|
||||
eyes_s.Blend(hair_s, ICON_OVERLAY)
|
||||
|
||||
S = facial_hair_styles_list[facial_hair_style]
|
||||
if(S)
|
||||
var/icon/facial_s = new/icon("icon" = S.icon, "icon_state" = "[S.icon_state]_s")
|
||||
facial_s.Blend("#[facial_hair_color]", ICON_ADD)
|
||||
facial_s.Blend("#[facial_hair_color]", ICON_MULTIPLY)
|
||||
eyes_s.Blend(facial_s, ICON_OVERLAY)
|
||||
|
||||
var/icon/clothes_s = null
|
||||
|
||||
@@ -189,7 +189,7 @@ When thinking about new stuff, check here to see if there are any slots unfilled
|
||||
//SYNDICATE
|
||||
1 | Sleepypen
|
||||
2 | TYRANT Module, Emag
|
||||
3 | Cloaking Device, Power Sink
|
||||
3 | Power Sink
|
||||
4 |
|
||||
5 |
|
||||
6 |
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Reference in New Issue
Block a user