Merge conflict fixes, Uses newly refactor actions, All cursed hearts can now be inserted by hand, not just wizard ones. Fixes organ actions trying to be granted to the object, not the user.

Merge branch 'master' of https://github.com/tgstation/-tg-station into cursed_heart

Conflicts:
	code/modules/surgery/organs/organ_internal.dm
This commit is contained in:
Remie Richards
2016-02-24 02:33:22 +00:00
181 changed files with 129299 additions and 14463 deletions
+2 -1
View File
@@ -31,12 +31,13 @@
name = "Activate Pill"
/datum/action/item_action/hands_free/activate_pill/Trigger()
if(!..() || CheckRemoval(owner))
if(!..())
return 0
owner << "<span class='caution'>You grit your teeth and burst the implanted [target]!</span>"
add_logs(owner, null, "swallowed an implanted pill", target)
if(target.reagents.total_volume)
target.reagents.reaction(owner, INGEST)
target.reagents.trans_to(owner, target.reagents.total_volume)
Remove(owner)
qdel(target)
return 1
@@ -47,7 +47,7 @@
implant_color = "#DE7E00"
slot = "brain_antidrop"
origin_tech = "materials=5;programming=4;biotech=4"
organ_action_name = "Toggle Anti-Drop"
actions_types = list(/datum/action/item_action/organ_action/toggle)
/obj/item/organ/internal/cyberimp/brain/anti_drop/ui_action_click()
active = !active
@@ -260,7 +260,7 @@
implant_color = "#007ACC"
slot = "shoulders"
origin_tech = "materials=5;biotech=4;powerstorage=4"
organ_action_name = "Toggle Arm Mod"
actions_types = list(/datum/action/item_action/organ_action/toggle)
var/obj/holder//is defined as the retractable item itself. ensure this is defined somewhere!
var/out = 0//determines if the item is in the owner's hand or not
var/overloaded = 0//is set to 1 when owner gets EMPed. if set to 1, implant doesn't work.
@@ -309,7 +309,7 @@
desc = "A variant of the arm cannon implant that fires electrodes and disabler shots. The cannon emerges from the subject's arms and remains in the shoulders when not in use."
icon_state = "armcannon_tase_implant"
origin_tech = "materials=5;combat=5;biotech=4;powerstorage=4"
organ_action_name = "Toggle Arm Cannon Taser"
actions_types = list(/datum/action/item_action/organ_action/toggle)
/obj/item/organ/internal/cyberimp/chest/arm_mod/tase/New()//when the implant is created...
holder = new /obj/item/weapon/gun/energy/gun/advtaser/mounted(src)//assign a brand new item to it. (in this case, a gun)
@@ -319,7 +319,7 @@
desc = "A variant of the arm cannon implant that fires lethal laser beams. The cannon emerges from the subject's arms and remains in the shoulders when not in use."
icon_state = "armcannon_lase_implant"
origin_tech = "materials=5;combat=5;biotech=4;powerstorage=4;syndicate=5"//this is kinda nutty and i might lower it
organ_action_name = "Toggle Arm Cannon Laser"
actions_types = list(/datum/action/item_action/organ_action/toggle)
/obj/item/organ/internal/cyberimp/chest/arm_mod/lase/New()
holder = new /obj/item/weapon/gun/energy/laser/mounted(src)
+18 -23
View File
@@ -6,17 +6,6 @@
var/zone = "chest"
var/slot
var/vital = 0
var/organ_action_name = null //This needs to die, like the rest of the old action_button_name system
var/datum/action/organ_actions = list() //List of typepaths, becomes a list of datums after New()
/obj/item/organ/internal/New()
..()
for(var/action_path in organ_actions)
organ_actions -= action_path
var/datum/action/A = new action_path()
A.target = src
organ_actions += A
/obj/item/organ/internal/proc/Insert(mob/living/carbon/M, special = 0)
@@ -30,11 +19,8 @@
owner = M
M.internal_organs |= src
loc = null
if(organ_action_name)
action_button_name = organ_action_name
for(var/action in organ_actions)
var/datum/action/A = action
for(var/X in actions)
var/datum/action/A = X
A.Grant(M)
@@ -44,14 +30,11 @@
M.internal_organs -= src
if(vital && !special)
M.death()
if(organ_action_name)
action_button_name = null
for(var/action in organ_actions)
var/datum/action/A = action
for(var/X in actions)
var/datum/action/A = X
A.Remove(M)
/obj/item/organ/internal/proc/on_find(mob/living/finder)
return
@@ -95,6 +78,9 @@
else
..()
/obj/item/organ/internal/item_action_slot_check(slot,mob/user)
return //so we don't grant the organ's action to mobs who pick up the organ.
//Looking for brains?
//Try code/modules/mob/living/carbon/brain/brain_item.dm
@@ -139,7 +125,7 @@
icon_state = "cursedheart-off"
icon_base = "cursedheart"
origin_tech = "biotech=5"
organ_actions = list(/datum/action/item_action/organ_action/cursed_heart)
actions_types = list(/datum/action/item_action/organ_action/cursed_heart)
var/last_pump = 0
var/pump_delay = 30 //you can pump 1 second early, for lag, but no more (otherwise you could spam heal)
var/blood_loss = 100 //600 blood is human default, so 5 failures (below 122 blood is where humans die because reasons?)
@@ -149,6 +135,15 @@
var/heal_burn = 0
var/heal_oxy = 0
/obj/item/organ/internal/heart/cursed/attack(mob/living/carbon/human/H, mob/living/carbon/human/user, obj/target)
if(H == user && istype(H))
playsound(user,'sound/effects/singlebeat.ogg',40,1)
user.drop_item()
Insert(user)
else
return ..()
/obj/item/organ/internal/heart/cursed/on_life()
if(world.time > (last_pump + pump_delay))
if(ishuman(owner) && owner.client) //While this entire item exists to make people suffer, they can't control disconnects.