Merge pull request #8645 from mwerezak/gun-icons

Adds Skowron's inhand icons for various guns
This commit is contained in:
Zuhayr
2015-03-31 14:12:03 +10:30
26 changed files with 93 additions and 31 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
/proc/getbrokeninhands()
var/icon/IL = new('icons/mob/items_lefthand.dmi')
var/icon/IL = new('icons/mob/items/lefthand.dmi')
var/list/Lstates = IL.IconStates()
var/icon/IR = new('icons/mob/items_righthand.dmi')
var/icon/IR = new('icons/mob/items/righthand.dmi')
var/list/Rstates = IR.IconStates()
@@ -856,37 +856,47 @@ proc/get_damage_icon_part(damage_state, body_part)
/mob/living/carbon/human/update_inv_r_hand(var/update_icons=1)
if(r_hand)
r_hand.screen_loc = ui_rhand //TODO
var/t_icon = INV_R_HAND_DEF_ICON
if(r_hand.item_icons && (icon_r_hand in r_hand.item_icons))
t_icon = r_hand.item_icons[icon_r_hand]
var/t_state = r_hand.item_state //useful for clothing that changes icon_state but retains the same sprite on the mob when held in hand
if(!t_state) t_state = r_hand.icon_state
if(r_hand.icon_override)
t_state = "[t_state]_r"
overlays_standing[R_HAND_LAYER] = image("icon" = r_hand.icon_override, "icon_state" = "[t_state]")
else
overlays_standing[R_HAND_LAYER] = image("icon" = 'icons/mob/items_righthand.dmi', "icon_state" = "[t_state]")
overlays_standing[R_HAND_LAYER] = image("icon" = t_icon, "icon_state" = "[t_state]")
if (handcuffed) drop_r_hand()
else
overlays_standing[R_HAND_LAYER] = null
if(update_icons) update_icons()
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_l_hand(var/update_icons=1)
if(l_hand)
l_hand.screen_loc = ui_lhand //TODO
var/t_icon = INV_L_HAND_DEF_ICON
if(l_hand.item_icons && (icon_l_hand in l_hand.item_icons))
t_icon = l_hand.item_icons[icon_l_hand]
var/t_state = l_hand.item_state //useful for clothing that changes icon_state but retains the same sprite on the mob when held in hand
if(!t_state) t_state = l_hand.icon_state
if(l_hand.icon_override)
t_state = "[t_state]_l"
overlays_standing[L_HAND_LAYER] = image("icon" = l_hand.icon_override, "icon_state" = "[t_state]")
else
overlays_standing[L_HAND_LAYER] = image("icon" = 'icons/mob/items_lefthand.dmi', "icon_state" = "[t_state]")
overlays_standing[L_HAND_LAYER] = image("icon" = t_icon, "icon_state" = "[t_state]")
if (handcuffed) drop_l_hand()
else
overlays_standing[L_HAND_LAYER] = null
if(update_icons) update_icons()
if(update_icons) update_icons()
/mob/living/carbon/human/proc/update_tail_showing(var/update_icons=1)
overlays_standing[TAIL_LAYER] = null
@@ -55,26 +55,38 @@
/mob/living/carbon/monkey/update_inv_r_hand(var/update_icons=1)
if(r_hand)
var/t_icon = INV_R_HAND_DEF_ICON
if(r_hand.item_icons && (icon_r_hand in r_hand.item_icons))
t_icon = r_hand.item_icons[icon_r_hand]
var/t_state = r_hand.item_state
if(!t_state) t_state = r_hand.icon_state
overlays_standing[M_R_HAND_LAYER] = image("icon" = 'icons/mob/items_righthand.dmi', "icon_state" = t_state)
overlays_standing[M_R_HAND_LAYER] = image("icon" = t_icon, "icon_state" = t_state)
r_hand.screen_loc = ui_rhand
if (handcuffed) drop_r_hand()
else
overlays_standing[M_R_HAND_LAYER] = null
if(update_icons) update_icons()
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_l_hand(var/update_icons=1)
if(l_hand)
var/t_icon = INV_L_HAND_DEF_ICON
if(l_hand.item_icons && (icon_l_hand in l_hand.item_icons))
t_icon = l_hand.item_icons[icon_l_hand]
var/t_state = l_hand.item_state
if(!t_state) t_state = l_hand.icon_state
overlays_standing[M_L_HAND_LAYER] = image("icon" = 'icons/mob/items_lefthand.dmi', "icon_state" = t_state)
overlays_standing[M_L_HAND_LAYER] = image("icon" = t_icon, "icon_state" = t_state)
l_hand.screen_loc = ui_lhand
if (handcuffed) drop_l_hand()
else
overlays_standing[M_L_HAND_LAYER] = null
if(update_icons) update_icons()
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_back(var/update_icons=1)
@@ -375,7 +375,7 @@ datum/preferences
if(LAWYER)
clothes_s = new /icon('icons/mob/uniform.dmi', "internalaffairs_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "briefcase"), ICON_UNDERLAY)
clothes_s.Blend(new /icon(INV_R_HAND_DEF_ICON, "briefcase"), ICON_UNDERLAY)
if(prob(1))
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "suitjacket_blue"), ICON_OVERLAY)
switch(backbag)
@@ -534,7 +534,7 @@ datum/preferences
clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY)
if(prob(1))
clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "toolbox_blue"), ICON_OVERLAY)
clothes_s.Blend(new /icon(INV_R_HAND_DEF_ICON, "toolbox_blue"), ICON_OVERLAY)
switch(backbag)
if(2)
clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY)
@@ -620,7 +620,7 @@ datum/preferences
clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY)
clothes_s.Blend(new /icon('icons/mob/head.dmi', "hardhat0_white"), ICON_OVERLAY)
if(prob(1))
clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "blueprints"), ICON_OVERLAY)
clothes_s.Blend(new /icon(INV_R_HAND_DEF_ICON, "blueprints"), ICON_OVERLAY)
switch(backbag)
if(2)
clothes_s.Blend(new /icon('icons/mob/back.dmi', "engiepack"), ICON_OVERLAY)
+5
View File
@@ -1,6 +1,11 @@
//Most of these are defined at this level to reduce on checks elsewhere in the code.
//Having them here also makes for a nice reference list of the various overlay-updating procs available
//default item on-mob icons
#define INV_L_HAND_DEF_ICON 'icons/mob/items/lefthand.dmi'
#define INV_R_HAND_DEF_ICON 'icons/mob/items/righthand.dmi'
/mob/proc/regenerate_icons() //TODO: phase this out completely if possible
return
+5 -4
View File
@@ -3,6 +3,10 @@
name = "gun"
desc = "Its a gun. It's pretty terrible, though."
icon = 'icons/obj/gun.dmi'
item_icons = list(
icon_l_hand = 'icons/mob/items/lefthand_guns.dmi',
icon_r_hand = 'icons/mob/items/righthand_guns.dmi',
)
icon_state = "detective"
item_state = "gun"
flags = CONDUCT
@@ -134,10 +138,7 @@
handle_post_fire(user, target, pointblank, reflex)
update_icon()
if(user.hand)
user.update_inv_l_hand()
else
user.update_inv_r_hand()
update_held_icon()
//obtains the next projectile to fire
+2
View File
@@ -29,6 +29,7 @@
power_supply.give(power_supply.maxcharge)
if(self_recharge)
processing_objects.Add(src)
update_icon()
/obj/item/weapon/gun/energy/Del()
if(self_recharge)
@@ -87,3 +88,4 @@
icon_state = "[modifystate][ratio]"
else
icon_state = "[initial(icon_state)][ratio]"
@@ -24,16 +24,18 @@
obj/item/weapon/gun/energy/retro
name = "retro laser"
icon_state = "retro"
item_state = "retro"
desc = "An older model of the basic lasergun, no longer used by Nanotrasen's security or military forces. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws."
fire_sound = 'sound/weapons/Laser.ogg'
slot_flags = SLOT_BELT
w_class = 3
projectile_type = /obj/item/projectile/beam
fire_delay = 10
fire_delay = 10 //old technology
/obj/item/weapon/gun/energy/captain
name = "antique laser gun"
icon_state = "caplaser"
item_state = "caplaser"
desc = "This is an antique laser gun. All craftsmanship is of the highest quality. It is decorated with assistant leather and chrome. The object menaces with spikes of energy. On the item is an image of Space Station 13. The station is exploding."
force = 5
fire_sound = 'sound/weapons/Laser.ogg'
@@ -48,7 +50,7 @@ obj/item/weapon/gun/energy/retro
name = "laser cannon"
desc = "With the laser cannon, the lasing medium is enclosed in a tube lined with uranium-235 and subjected to high neutron flux in a nuclear reactor core. This incredible technology may help YOU achieve high excitation rates with small laser volumes!"
icon_state = "lasercannon"
item_state = "laser"
item_state = null
fire_sound = 'sound/weapons/lasercannonfire.ogg'
origin_tech = "combat=4;materials=3;powerstorage=3"
slot_flags = SLOT_BELT|SLOT_BACK
@@ -66,6 +68,7 @@ obj/item/weapon/gun/energy/retro
name = "xray laser gun"
desc = "A high-power laser gun capable of expelling concentrated xray blasts."
icon_state = "xray"
item_state = "xray"
fire_sound = 'sound/weapons/laser3.ogg'
origin_tech = "combat=5;materials=3;magnets=2;syndicate=2"
projectile_type = /obj/item/projectile/beam/xray
@@ -117,10 +120,12 @@ obj/item/weapon/gun/energy/retro
/obj/item/weapon/gun/energy/lasertag/blue
icon_state = "bluetag"
item_state = "bluetag"
projectile_type = /obj/item/projectile/beam/lastertag/blue
required_vest = /obj/item/clothing/suit/bluetag
/obj/item/weapon/gun/energy/lasertag/red
icon_state = "redtag"
item_state = "redtag"
projectile_type = /obj/item/projectile/beam/lastertag/red
required_vest = /obj/item/clothing/suit/redtag
@@ -29,10 +29,7 @@
projectile_type = /obj/item/projectile/beam/stun
modifystate = "energystun"
update_icon()
if(user.l_hand == src)
user.update_inv_l_hand()
else
user.update_inv_r_hand()
update_held_icon()
/obj/item/weapon/gun/energy/gun/mounted
name = "mounted energy gun"
@@ -26,6 +26,7 @@
name = "biological demolecularisor"
desc = "A gun that discharges high amounts of controlled radiation to slowly break a target into component elements."
icon_state = "decloner"
item_state = "decloner"
fire_sound = 'sound/weapons/pulse3.ogg'
origin_tech = "combat=5;materials=4;powerstorage=3"
charge_cost = 100
@@ -35,7 +36,7 @@
name = "floral somatoray"
desc = "A tool that discharges controlled radiation which induces mutation in plant cells."
icon_state = "floramut100"
item_state = "obj/item/gun.dmi"
item_state = "floramut"
fire_sound = 'sound/effects/stealthoff.ogg'
charge_cost = 100
projectile_type = /obj/item/projectile/energy/floramut
@@ -59,7 +60,7 @@
projectile_type = /obj/item/projectile/energy/floramut
modifystate = "floramut"
update_icon()
return
update_held_icon()
/obj/item/weapon/gun/energy/floragun/afterattack(obj/target, mob/user, adjacent_flag)
//allow shooting into adjacent hydrotrays regardless of intent
@@ -115,6 +116,7 @@
name = "staff of change"
desc = "An artefact that spits bolts of coruscating energy which cause the target's very form to reshape itself"
icon = 'icons/obj/gun.dmi'
item_icons = null
icon_state = "staffofchange"
item_state = "staffofchange"
fire_sound = 'sound/weapons/emitter.ogg'
@@ -168,6 +170,7 @@ obj/item/weapon/gun/energy/staff/focus
desc = "It's a cute rubber duck. With an evil gleam in it's eye."
projectile_type = /obj/item/projectile/icarus/pointdefense
icon = 'icons/obj/watercloset.dmi'
item_icons = null
icon_state = "rubberducky"
item_state = "rubberducky"
charge_cost = 0
@@ -23,6 +23,7 @@
name = "stun revolver"
desc = "A high-tech revolver that fires stun cartridges. The stun cartridges can be recharged using a conventional energy weapon recharger."
icon_state = "stunrevolver"
item_state = "stunrevolver"
fire_sound = 'sound/weapons/Gunshot.ogg'
origin_tech = "combat=3;materials=3;powerstorage=2"
charge_cost = 125
@@ -133,4 +133,5 @@
name = "syringe gun revolver"
desc = "A modification of the syringe gun design, using a rotating cylinder to store up to five syringes. The spring still needs to be drawn between shots."
icon_state = "rapidsyringegun"
item_state = "rapidsyringegun"
max_darts = 5
@@ -51,7 +51,7 @@
name = "\improper STS-35 automatic rifle"
desc = "A durable, rugged looking automatic weapon of a make popular on the frontier worlds. Uses 7.62mm rounds. It is unmarked."
icon_state = "arifle"
item_state = "l6closednomag" //placeholder
item_state = null
w_class = 4
force = 10
caliber = "a762"
@@ -63,12 +63,13 @@
/obj/item/weapon/gun/projectile/automatic/sts35/update_icon()
..()
icon_state = (ammo_magazine)? "arifle-0" : "arifle"
update_held_icon()
/obj/item/weapon/gun/projectile/automatic/wt550
name = "\improper W-T 550 Saber"
desc = "A cheap, mass produced Ward-Takahashi PDW. Uses 9mm rounds."
icon_state = "wt550"
item_state = "c20r" //placeholder
item_state = "wt550"
w_class = 3
caliber = "9mm"
origin_tech = "combat=5;materials=2"
@@ -90,7 +91,7 @@
name = "\improper Z8 Bulldog"
desc = "An older model bullpup carbine, made by the now defunct Zendai Foundries. Uses armor piercing 5.56mm rounds. Makes you feel like a space marine when you hold it."
icon_state = "carbine"
item_state = "l6closednomag" //placeholder
item_state = "z8carbine"
w_class = 4
force = 10
caliber = "a556"
@@ -43,6 +43,7 @@
name = "dart gun"
desc = "A small gas-powered dartgun, capable of delivering chemical cocktails swiftly across short distances."
icon_state = "dartgun-empty"
item_state = null
caliber = "dart"
fire_sound = 'sound/weapons/empty.ogg'
@@ -63,6 +63,7 @@
name = "desert eagle"
desc = "A robust handgun that uses .50 AE ammo"
icon_state = "deagle"
item_state = "deagle"
force = 14.0
caliber = ".50"
load_method = MAGAZINE
@@ -107,6 +108,7 @@
name = "\improper Stechtkin pistol"
desc = "A small, easily concealable gun. Uses 9mm rounds."
icon_state = "pistol"
item_state = null
w_class = 2
caliber = "9mm"
silenced = 0
@@ -2,6 +2,7 @@
name = "revolver"
desc = "A classic revolver. Uses .357 ammo"
icon_state = "revolver"
item_state = "revolver"
caliber = "357"
origin_tech = "combat=2;materials=2"
handle_casings = CYCLE_CASINGS
@@ -42,6 +42,7 @@
/obj/item/weapon/gun/projectile/shotgun/pump/combat
name = "combat shotgun"
icon_state = "cshotgun"
item_state = "cshotgun"
origin_tech = "combat=5;materials=2"
max_shells = 7 //match the ammo box capacity, also it can hold a round in the chamber anyways, for a total of 8.
ammo_type = /obj/item/ammo_casing/shotgun
@@ -51,7 +52,7 @@
name = "double-barreled shotgun"
desc = "A true classic."
icon_state = "dshotgun"
item_state = "shotgun"
item_state = "dshotgun"
//SPEEDLOADER because rapid unloading.
//In principle someone could make a speedloader for it, so it makes sense.
load_method = SINGLE_CASING|SPEEDLOADER