added ethereals
This commit is contained in:
@@ -838,6 +838,46 @@
|
||||
// attack with hand - remove cell (if cover open) or interact with the APC
|
||||
|
||||
/obj/machinery/power/apc/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
|
||||
if(isethereal(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.a_intent == INTENT_HARM)
|
||||
if(cell.charge <= (cell.maxcharge / 2)) // if charge is under 50% you shouldnt drain it
|
||||
to_chat(H, "<span class='warning'>The APC doesn't have much power, you probably shouldn't drain any.</span>")
|
||||
return
|
||||
var/obj/item/organ/stomach/ethereal/stomach = H.getorganslot(ORGAN_SLOT_STOMACH)
|
||||
if(stomach.crystal_charge > 145)
|
||||
to_chat(H, "<span class='warning'>Your charge is full!</span>")
|
||||
return
|
||||
to_chat(H, "<span class='notice'>You start channeling some power through the APC into your body.</span>")
|
||||
if(do_after(user, 75, target = src))
|
||||
if(cell.charge <= (cell.maxcharge / 2) || (stomach.crystal_charge > 145))
|
||||
return
|
||||
if(istype(stomach))
|
||||
to_chat(H, "<span class='notice'>You receive some charge from the APC.</span>")
|
||||
stomach.adjust_charge(10)
|
||||
cell.charge -= 10
|
||||
else
|
||||
to_chat(H, "<span class='warning'>You can't receive charge from the APC!</span>")
|
||||
return
|
||||
if(H.a_intent == INTENT_GRAB)
|
||||
if(cell.charge == cell.maxcharge)
|
||||
to_chat(H, "<span class='warning'>The APC is full!</span>")
|
||||
return
|
||||
var/obj/item/organ/stomach/ethereal/stomach = H.getorganslot(ORGAN_SLOT_STOMACH)
|
||||
if(stomach.crystal_charge < 10)
|
||||
to_chat(H, "<span class='warning'>Your charge is too low!</span>")
|
||||
return
|
||||
to_chat(H, "<span class='notice'>You start channeling power through your body into the APC.</span>")
|
||||
if(do_after(user, 75, target = src))
|
||||
if(cell.charge == cell.maxcharge || (stomach.crystal_charge < 10))
|
||||
return
|
||||
if(istype(stomach))
|
||||
to_chat(H, "<span class='notice'>You transfer some power to the APC.</span>")
|
||||
stomach.adjust_charge(-10)
|
||||
cell.charge += 10
|
||||
else
|
||||
to_chat(H, "<span class='warning'>You can't transfer power to the APC!</span>")
|
||||
return
|
||||
if(opened && (!issilicon(user)))
|
||||
if(cell)
|
||||
user.visible_message("[user] removes \the [cell] from [src]!","<span class='notice'>You remove \the [cell].</span>")
|
||||
|
||||
@@ -151,6 +151,27 @@
|
||||
if(prob(25))
|
||||
corrupt()
|
||||
|
||||
/obj/item/stock_parts/cell/attack_self(mob/user)
|
||||
if(isethereal(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(charge < 100)
|
||||
to_chat(H, "<span class='warning'>The [src] doesn't have enough power!</span>")
|
||||
return
|
||||
var/obj/item/organ/stomach/ethereal/stomach = H.getorganslot(ORGAN_SLOT_STOMACH)
|
||||
if(stomach.crystal_charge > 146)
|
||||
to_chat(H, "<span class='warning'>Your charge is full!</span>")
|
||||
return
|
||||
to_chat(H, "<span class='notice'>You clumsily channel power through the [src] and into your body, wasting some in the process.</span>")
|
||||
if(do_after(user, 5, target = src))
|
||||
if((charge < 100) || (stomach.crystal_charge > 146))
|
||||
return
|
||||
if(istype(stomach))
|
||||
to_chat(H, "<span class='notice'>You receive some charge from the [src].</span>")
|
||||
stomach.adjust_charge(3)
|
||||
charge -= 100 //you waste way more than you receive, so that ethereals cant just steal one cell and forget about hunger
|
||||
else
|
||||
to_chat(H, "<span class='warning'>You can't receive charge from the [src]!</span>")
|
||||
return
|
||||
|
||||
/obj/item/stock_parts/cell/blob_act(obj/structure/blob/B)
|
||||
ex_act(EXPLODE_DEVASTATE)
|
||||
|
||||
@@ -610,7 +610,18 @@
|
||||
var/mob/living/carbon/human/H = user
|
||||
|
||||
if(istype(H))
|
||||
|
||||
var/datum/species/ethereal/eth_species = H.dna?.species
|
||||
if(istype(eth_species))
|
||||
to_chat(H, "<span class='notice'>You start channeling some power through the [fitting] into your body.</span>")
|
||||
if(do_after(user, 50, target = src))
|
||||
var/obj/item/organ/stomach/ethereal/stomach = H.getorganslot(ORGAN_SLOT_STOMACH)
|
||||
if(istype(stomach))
|
||||
to_chat(H, "<span class='notice'>You receive some charge from the [fitting].</span>")
|
||||
stomach.adjust_charge(2)
|
||||
else
|
||||
to_chat(H, "<span class='warning'>You can't receive charge from the [fitting]!</span>")
|
||||
return
|
||||
|
||||
if(H.gloves)
|
||||
var/obj/item/clothing/gloves/G = H.gloves
|
||||
if(G.max_heat_protection_temperature)
|
||||
|
||||
Reference in New Issue
Block a user