Merge pull request #14148 from SabreML/Cling-icon-merge

Combines Changeling 'Channel DNA' and 'Absorb DNA' into one button
This commit is contained in:
AffectedArc07
2020-09-06 11:25:49 +01:00
committed by GitHub
2 changed files with 20 additions and 32 deletions
@@ -370,16 +370,11 @@ GLOBAL_LIST_EMPTY(sting_paths)
mind.changeling.purchasedpowers += path
path.on_purchase(src)
else //for respec
var/datum/action/changeling/hivemind_upload/S1 = new
var/datum/action/changeling/hivemind_pick/S1 = new
if(!mind.changeling.has_sting(S1))
mind.changeling.purchasedpowers+=S1
S1.Grant(src)
var/datum/action/changeling/hivemind_download/S2 = new
if(!mind.changeling.has_sting(S2))
mind.changeling.purchasedpowers+=S2
S2.Grant(src)
var/mob/living/carbon/C = src //only carbons have dna now, so we have to typecaste
mind.changeling.absorbed_dna |= C.dna.Clone()
mind.changeling.trim_dna()
@@ -12,27 +12,36 @@
var/datum/changeling/changeling=user.mind.changeling
changeling.changeling_speak = 1
to_chat(user, "<i><font color=#800080>Use say \":g message\" to communicate with the other changelings.</font></i>")
var/datum/action/changeling/hivemind_upload/S1 = new
var/datum/action/changeling/hivemind_pick/S1 = new
if(!changeling.has_sting(S1))
changeling.purchasedpowers+=S1
S1.Grant(user)
var/datum/action/changeling/hivemind_download/S2 = new
if(!changeling.has_sting(S2))
S2.Grant(user)
changeling.purchasedpowers+=S2
return
// HIVE MIND UPLOAD/DOWNLOAD DNA
GLOBAL_LIST_EMPTY(hivemind_bank)
/datum/action/changeling/hivemind_upload
/datum/action/changeling/hivemind_pick
name = "Hive Channel DNA"
desc = "Allows us to channel DNA in the airwaves to allow other changelings to absorb it. Costs 10 chemicals."
button_icon_state = "hivemind_channel"
desc = "Allows us to upload or absorb DNA in the airwaves. Does not count towards absorb objectives. Costs 10 chemicals."
button_icon_state = "hive_absorb"
chemical_cost = 10
dna_cost = -1
/datum/action/changeling/hivemind_upload/sting_action(var/mob/user)
/datum/action/changeling/hivemind_pick/sting_action(mob/user)
var/datum/changeling/changeling = user.mind.changeling
var/channel_pick = alert("Upload or Absorb DNA?", "Channel Select", "Upload", "Absorb")
if(channel_pick == "Upload")
dna_upload(user)
if(channel_pick == "Absorb")
if(changeling.using_stale_dna(user))//If our current DNA is the stalest, we gotta ditch it.
to_chat(user, "<span class='warning'>We have reached our capacity to store genetic information! We must transform before absorbing more.</span>")
return
else
dna_absorb(user)
/datum/action/changeling/proc/dna_upload(mob/user)
var/datum/changeling/changeling = user.mind.changeling
var/list/names = list()
for(var/datum/dna/DNA in (changeling.absorbed_dna+changeling.protected_dna))
@@ -56,23 +65,7 @@ GLOBAL_LIST_EMPTY(hivemind_bank)
feedback_add_details("changeling_powers","HU")
return 1
/datum/action/changeling/hivemind_download
name = "Hive Absorb DNA"
desc = "Allows us to absorb DNA that has been channeled to the airwaves. Does not count towards absorb objectives. Costs 10 chemicals."
button_icon_state = "hive_absorb"
chemical_cost = 10
dna_cost = -1
/datum/action/changeling/hivemind_download/can_sting(var/mob/living/carbon/user)
if(!..())
return
var/datum/changeling/changeling = user.mind.changeling
if(changeling.using_stale_dna(user))//If our current DNA is the stalest, we gotta ditch it.
to_chat(user, "<span class='warning'>We have reached our capacity to store genetic information! We must transform before absorbing more.</span>")
return
return 1
/datum/action/changeling/hivemind_download/sting_action(var/mob/user)
/datum/action/changeling/proc/dna_absorb(mob/user)
var/datum/changeling/changeling = user.mind.changeling
var/list/names = list()
for(var/datum/dna/DNA in GLOB.hivemind_bank)