Merge remote-tracking branch 'bay12-upstream/master' into development

This commit is contained in:
skull132
2016-10-07 00:58:39 +03:00
1594 changed files with 53994 additions and 48590 deletions
+67 -65
View File
@@ -1,6 +1,8 @@
/obj/item
name = "item"
icon = 'icons/obj/items.dmi'
w_class = 3.0
var/image/blood_overlay = null //this saves our blood splatter overlay, which will be processed not to go over the edges of the sprite
var/abstract = 0
var/r_speed = 1.0
@@ -8,11 +10,10 @@
var/burn_point = null
var/burning = null
var/hitsound = null
var/w_class = 3.0
var/storage_cost = null
var/slot_flags = 0 //This is used to determine on which slots an item can fit.
var/no_attack_log = 0 //If it's an item we don't want to log attack_logs with, set this to 1
pass_flags = PASSTABLE
pressure_resistance = 5
// causeerrorheresoifixthis
var/obj/item/master = null
@@ -21,11 +22,13 @@
var/max_heat_protection_temperature //Set this variable to determine up to which temperature (IN KELVIN) the item protects against heat damage. Keep at null to disable protection. Only protects areas set by heat_protection flags
var/min_cold_protection_temperature //Set this variable to determine down to which temperature (IN KELVIN) the item protects against cold damage. 0 is NOT an acceptable number due to if(varname) tests!! Keep at null to disable protection. Only protects areas set by cold_protection flags
var/icon_action_button //If this is set, The item will make an action button on the player's HUD when picked up. The button will have the icon_action_button sprite from the screen1_action.dmi file.
var/action_button_name //This is the text which gets displayed on the action button. If not set it defaults to 'Use [name]'. Note that icon_action_button needs to be set in order for the action button to appear.
var/datum/action/item_action/action = null
var/action_button_name //It is also the text which gets displayed on the action button. If not set it defaults to 'Use [name]'. If it's not set, there'll be no button.
var/action_button_is_hands_free = 0 //If 1, bypass the restrained, lying, and stunned checks action buttons normally test for
//Since any item can now be a piece of clothing, this has to be put here so all items share it.
var/flags_inv //This flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc.
//This flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc.
//It should be used purely for appearance. For gameplay effects caused by items covering body parts, use body_parts_covered.
var/flags_inv = 0
var/body_parts_covered = 0 //see setup.dm for appropriate bit flags
var/item_flags = 0 //Miscellaneous flags pertaining to equippable objects.
@@ -42,14 +45,19 @@
var/zoomdevicename = null //name used for message when binoculars/scope is used
var/zoom = 0 //1 if item is actively being used to zoom. For scoped guns and binoculars.
var/contained_sprite = 0 //1 if item_state, lefthand, righthand, and worn sprite are all in one dmi
var/item_state = null // Used to specify the item state for the on-mob overlays.
var/item_state_slots = null //overrides the default item_state for particular slots.
var/icon_override = null //Used to override hardcoded clothing dmis in human clothing proc.
//** These specify item/icon overrides for _slots_
var/list/item_state_slots = list() //overrides the default item_state for particular slots.
// Used to specify the icon file to be used when the item is worn. If not set the default icon for that slot will be used.
// If icon_override or sprite_sheets are set they will take precendence over this, assuming they apply to the slot in question.
// Only slot_l_hand/slot_r_hand are implemented at the moment. Others to be implemented as needed.
var/list/item_icons = null
var/list/item_icons = list()
//** These specify item/icon overrides for _species_
/* Species-specific sprites, concept stolen from Paradise//vg/.
ex:
@@ -58,13 +66,11 @@
)
If index term exists and icon_override is not set, this sprite sheet will be used.
*/
var/list/sprite_sheets = null
var/icon_override = null //Used to override hardcoded clothing dmis in human clothing proc.
var/list/sprite_sheets = list()
/* Species-specific sprite sheets for inventory sprites
Works similarly to worn sprite_sheets, except the alternate sprites are used when the clothing/refit_for_species() proc is called.
*/
var/list/sprite_sheets_obj = null
// Species-specific sprite sheets for inventory sprites
// Works similarly to worn sprite_sheets, except the alternate sprites are used when the clothing/refit_for_species() proc is called.
var/list/sprite_sheets_obj = list()
/obj/item/Destroy()
if(ismob(loc))
@@ -103,19 +109,6 @@
else
return
/obj/item/blob_act()
return
//user: The mob that is suiciding
//damagetype: The type of damage the item will inflict on the user
//BRUTELOSS = 1
//FIRELOSS = 2
//TOXLOSS = 4
//OXYLOSS = 8
//Output a creative message and then return the damagetype done
/obj/item/proc/suicide_act(mob/user)
return
/obj/item/verb/move_to_top()
set name = "Move To Top"
set category = "Object"
@@ -147,10 +140,17 @@
/obj/item/attack_hand(mob/user as mob)
if (!user) return
if (!user.can_use_hand())
return
if (hasorgans(user))
var/mob/living/carbon/human/H = user
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
if (user.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
user << "<span class='notice'>You try to move your [temp.name], but cannot!</span>"
return
if(!temp)
user << "<span class='notice'>You try to use your hand, but realize it is no longer attached!</span>"
return
src.pickup(user)
if (istype(src.loc, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = src.loc
@@ -163,8 +163,6 @@
else
if(isliving(src.loc))
return
user.next_move = max(user.next_move+2,world.time + 2)
user.put_in_active_hand(src)
return
@@ -203,7 +201,7 @@
else if(success)
user << "<span class='notice'>You put some things in [S].</span>"
else
user << "<span class='notice'>You fail to pick anything up with [S].</span>"
user << "<span class='notice'>You fail to pick anything up with \the [S].</span>"
else if(S.can_be_inserted(src))
S.handle_item_insertion(src)
@@ -341,7 +339,7 @@ var/list/global/slot_flags_enumeration = list(
var/allow = 0
if(H.back && istype(H.back, /obj/item/weapon/storage/backpack))
var/obj/item/weapon/storage/backpack/B = H.back
if(B.contents.len < B.storage_slots && w_class <= B.max_w_class)
if(B.can_be_inserted(src,1))
allow = 1
if(!allow)
return 0
@@ -377,22 +375,22 @@ var/list/global/slot_flags_enumeration = list(
if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr))
return
if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain)))//Is humanoid, and is not a brain
usr << "\red You can't pick things up!"
usr << "<span class='warning'>You can't pick things up!</span>"
return
if( usr.stat || usr.restrained() )//Is not asleep/dead and is not restrained
usr << "\red You can't pick things up!"
usr << "<span class='warning'>You can't pick things up!</span>"
return
if(src.anchored) //Object isn't anchored
usr << "\red You can't pick that up!"
usr << "<span class='warning'>You can't pick that up!</span>"
return
if(!usr.hand && usr.r_hand) //Right hand is not full
usr << "\red Your right hand is full."
usr << "<span class='warning'>Your right hand is full.</span>"
return
if(usr.hand && usr.l_hand) //Left hand is not full
usr << "\red Your left hand is full."
usr << "<span class='warning'>Your left hand is full.</span>"
return
if(!istype(src.loc, /turf)) //Object is on a turf
usr << "\red You can't pick that up!"
usr << "<span class='warning'>You can't pick that up!</span>"
return
//All checks are done, time to pick it up!
usr.UnarmedAttack(src)
@@ -403,11 +401,14 @@ var/list/global/slot_flags_enumeration = list(
//The default action is attack_self().
//Checks before we get to here are: mob is alive, mob is not restrained, paralyzed, asleep, resting, laying, item is on the mob.
/obj/item/proc/ui_action_click()
if( src in usr )
attack_self(usr)
attack_self(usr)
/obj/item/proc/IsShield()
//RETURN VALUES
//handle_shield should return a positive value to indicate that the attack is blocked and should be prevented.
//If a negative value is returned, it should be treated as a special return value for bullet_act() and handled appropriately.
//For non-projectile attacks this usually means the attack is blocked.
//Otherwise should return 0 to indicate that the attack is not affected in any way.
/obj/item/proc/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
return 0
/obj/item/proc/get_loc_turf()
@@ -419,28 +420,29 @@ var/list/global/slot_flags_enumeration = list(
/obj/item/proc/eyestab(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
var/mob/living/carbon/human/H = M
if(istype(H) && ( \
(H.head && H.head.flags & HEADCOVERSEYES) || \
(H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) || \
(H.glasses && H.glasses.flags & GLASSESCOVERSEYES) \
))
// you can't stab someone in the eyes wearing a mask!
user << "\red You're going to need to remove the eye covering first."
return
if(istype(H))
for(var/obj/item/protection in list(H.head, H.wear_mask, H.glasses))
if(protection && (protection.body_parts_covered & EYES))
// you can't stab someone in the eyes wearing a mask!
user << "<span class='warning'>You're going to need to remove the eye covering first.</span>"
return
if(!M.has_eyes())
user << "\red You cannot locate any eyes on [M]!"
user << "<span class='warning'>You cannot locate any eyes on [M]!</span>"
return
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>"
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>"
msg_admin_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)") //BS12 EDIT ALG
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(M)
src.add_fingerprint(user)
//if((CLUMSY in user.mutations) && prob(50))
// M = user
/*
M << "\red You stab yourself in the eye."
M << "<span class='warning'>You stab yourself in the eye.</span>"
M.sdisabilities |= BLIND
M.weakened += 4
M.adjustBruteLoss(10)
@@ -452,30 +454,30 @@ var/list/global/slot_flags_enumeration = list(
if(H != user)
for(var/mob/O in (viewers(M) - user - M))
O.show_message("\red [M] has been stabbed in the eye with [src] by [user].", 1)
M << "\red [user] stabs you in the eye with [src]!"
user << "\red You stab [M] in the eye with [src]!"
O.show_message("<span class='danger'>[M] has been stabbed in the eye with [src] by [user].</span>", 1)
M << "<span class='danger'>[user] stabs you in the eye with [src]!</span>"
user << "<span class='danger'>You stab [M] in the eye with [src]!</span>"
else
user.visible_message( \
"\red [user] has stabbed themself with [src]!", \
"\red You stab yourself in the eyes with [src]!" \
"<span class='danger'>[user] has stabbed themself with [src]!</span>", \
"<span class='danger'>You stab yourself in the eyes with [src]!</span>" \
)
eyes.damage += rand(3,4)
if(eyes.damage >= eyes.min_bruised_damage)
if(M.stat != 2)
if(eyes.robotic <= 1) //robot eyes bleeding might be a bit silly
M << "\red Your eyes start to bleed profusely!"
M << "<span class='danger'>Your eyes start to bleed profusely!</span>"
if(prob(50))
if(M.stat != 2)
M << "\red You drop what you're holding and clutch at your eyes!"
M << "<span class='warning'>You drop what you're holding and clutch at your eyes!</span>"
M.drop_item()
M.eye_blurry += 10
M.Paralyse(1)
M.Weaken(4)
if (eyes.damage >= eyes.min_broken_damage)
if(M.stat != 2)
M << "\red You go blind!"
M << "<span class='warning'>You go blind!</span>"
var/obj/item/organ/external/affecting = H.get_organ("head")
if(affecting.take_damage(7))
M:UpdateDamageIcon()