Skip to content

Commit

Permalink
Merge pull request tgstation#10285 from Ikarrus/gangimplantmania
Browse files Browse the repository at this point in the history
Gang Update: Implants Edition
  • Loading branch information
Razharas committed Jul 1, 2015
2 parents 0d07dc3 + b6dd414 commit ce02df7
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 110 deletions.
63 changes: 42 additions & 21 deletions code/game/gamemodes/gang/gang.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
var/A_timer = "OFFLINE"
var/B_timer = "OFFLINE"
//How many attempts at domination each team is allowed
var/A_dominations = 2
var/B_dominations = 2
var/A_dominations = 3
var/B_dominations = 3
///////////////////////////
//Announces the game type//
///////////////////////////
Expand All @@ -54,7 +54,11 @@
if(config.protect_assistant_from_antagonist)
restricted_jobs += "Assistant"

if(antag_candidates.len >= 2)
//Spawn more bosses depending on server population
assign_bosses(1)
if(num_players() >= 30) //30
assign_bosses()
if(num_players() >= 40) //40
assign_bosses()

if(!A_bosses.len || !B_bosses.len)
Expand Down Expand Up @@ -91,20 +95,23 @@

check_win()

/datum/game_mode/gang/proc/assign_bosses()
/datum/game_mode/gang/proc/assign_bosses(var/leader)
if(antag_candidates.len < 2) //Not enough bosses
return

var/datum/mind/boss = pick(antag_candidates)
A_bosses += boss
antag_candidates -= boss
boss.special_role = "[gang_name("A")] Gang (A) Boss"
boss.special_role = "[gang_name("A")] Gang (A) [leader ? "Boss" : "Lieutenant"]"
boss.restricted_roles = restricted_jobs
log_game("[boss.key] has been selected as the boss for the [gang_name("A")] Gang (A)")
log_game("[boss.key] has been selected as a [leader ? "Boss" : "Lieutenant"] for the [gang_name("A")] Gang (A)")

boss = pick(antag_candidates)
B_bosses += boss
antag_candidates -= boss
boss.special_role = "[gang_name("B")] Gang (B) Boss"
boss.special_role = "[gang_name("B")] Gang (B) [leader ? "Boss" : "Lieutenant"]"
boss.restricted_roles = restricted_jobs
log_game("[boss.key] has been selected as the boss for the [gang_name("B")] Gang (B)")
log_game("[boss.key] has been selected as a [leader ? "Boss" : "Lieutenant"] for the [gang_name("B")] Gang (B)")

/datum/game_mode/proc/forge_gang_objectives(var/datum/mind/boss_mind)
if(istype(ticker.mode, /datum/game_mode/gang))
Expand All @@ -127,8 +134,9 @@

/datum/game_mode/proc/greet_gang(var/datum/mind/boss_mind, var/you_are=1)
var/obj_count = 1
var/isboss = (boss_mind==A_bosses[1] || boss_mind==B_bosses[1])
if (you_are)
boss_mind.current << "<FONT size=3 color=red><B>You are the founding member of the [(boss_mind in A_bosses) ? gang_name("A") : gang_name("B")] Gang!</B></FONT>"
boss_mind.current << "<FONT size=3 color=red><B>You are [isboss ? "the Boss of" : "a Lieutenant in"] the [(boss_mind in A_bosses) ? gang_name("A") : gang_name("B")] Gang!</B></FONT>"
for(var/datum/objective/objective in boss_mind.objectives)
boss_mind.current << "<B>Objective #[obj_count]</B>: [objective.explanation_text]"
obj_count++
Expand All @@ -151,13 +159,20 @@
if(!istype(mob))
return

var/isboss
if (mob.mind)
isboss = (mob.mind==A_bosses[1] || mob.mind==B_bosses[1])
if (mob.mind.assigned_role == "Clown")
mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself."
mob.dna.remove_mutation(CLOWNMUT)

var/obj/item/device/gangtool/gangtool
if(isboss)
gangtool = new(mob)
else
var/obj/item/device/gangtool/lt/lt_tool = new(mob)
gangtool = lt_tool
var/obj/item/weapon/pen/gang/T = new(mob)
var/obj/item/device/gangtool/gangtool = new(mob)
var/obj/item/toy/crayon/spraycan/gang/SC = new(mob)

var/list/slots = list (
Expand All @@ -176,8 +191,7 @@
. += 1
else
gangtool.register_device(mob)
mob << "The <b>Gangtool</b> in your [where] will allow you to purchase items, send messages to your gangsters and recall the emergency shuttle from anywhere on the station."
mob << "You can also promote your gang members to <b>lieutenant</b> by having them use an unregistered gangtool. Unlike regular gangsters, Lieutenants cannot be deconverted and are able to use recruitment pens and gangtools."
mob << "The <b>Gangtool</b> in your [where] will allow you to purchase weapons and equipment, send messages to your gang, and recall the emergency shuttle from anywhere on the station."

var/where2 = mob.equip_in_one_of_slots(T, slots)
if (!where2)
Expand All @@ -198,7 +212,7 @@


//Used by recallers when purchasing a gang outfit. First time a gang outfit is purchased the buyer decides a gang style which is stored so gang outfits are uniform
/datum/game_mode/proc/gang_outfit(mob/user,var/obj/item/device/gangtool/gangtool,var/gang)
/datum/game_mode/proc/gang_outfit(mob/living/carbon/user,var/obj/item/device/gangtool/gangtool,var/gang)
if(!user || !gangtool || !gang)
return 0
if(!gangtool.can_use(user))
Expand All @@ -208,12 +222,18 @@
var/style
if(gang == "A")
if(!A_style)
A_style = input("Pick an outfit style.", "Pick Style") as null|anything in gang_style_list
if(gangtool.outfits >=3) //Gives the gang boss a few minutes to pick a style first before someone else gets to
A_style = input("Pick an outfit style.", "Pick Style") as null|anything in gang_style_list
else
user << "<span class='warning'>Your gang boss hasn't picked a style yet!</span>"
style = A_style

if(gang == "B")
if(!B_style)
B_style = input("Pick an outfit style.", "Pick Style") as null|anything in gang_style_list
if(gangtool.outfits >=3) //Gives the gang boss a few minutes to pick a style first before someone else gets to
B_style = input("Pick an outfit style.", "Pick Style") as null|anything in gang_style_list
else
user << "<span class='warning'>Your gang boss hasn't picked a style yet!</span>"
style = B_style

if(!style)
Expand Down Expand Up @@ -252,6 +272,7 @@
outfit.armor = list(melee = 20, bullet = 30, laser = 10, energy = 10, bomb = 20, bio = 0, rad = 0)
outfit.desc += " Tailored for the [gang_name(gang)] Gang to offer the wearer moderate protection against ballistics and physical trauma."
outfit.gang = gang
user.put_in_any_hand_if_possible(outfit)
return 1

return 0
Expand Down Expand Up @@ -305,11 +326,11 @@
carbon_mob.silent = max(carbon_mob.silent, 5)
carbon_mob.flash_eyes(1, 1)
gangster_mind.current.Stun(5)
gangster_mind.current << "<FONT size=3 color=red><B>You are now a member of the [gang=="A" ? gang_name("A") : gang_name("B")] Gang!</B></FONT>"
gangster_mind.current << "<FONT size=3 color=red><B>You are now a member of the [gang_name(gang)] Gang!</B></FONT>"
gangster_mind.current << "<font color='red'>Help your bosses take over the station by claiming territory with <b>special spraycans</b> only they can provide. Simply spray on any unclaimed area of the station.</font>"
gangster_mind.current << "<font color='red'>You can identify your bosses by their <b>red \[G\] icon</b>.</font>"
gangster_mind.current.attack_log += "\[[time_stamp()]\] <font color='red'>Has been converted to the [gang=="A" ? "[gang_name("A")] Gang (A)" : "[gang_name("B")] Gang (B)"]!</font>"
gangster_mind.special_role = "[gang=="A" ? "[gang_name("A")] Gang (A)" : "[gang_name("B")] Gang (B)"]"
gangster_mind.current.attack_log += "\[[time_stamp()]\] <font color='red'>Has been converted to the [gang_name(gang)] Gang ([gang])!</font>"
gangster_mind.special_role = "[gang_name(gang)] Gang ([gang])"
update_gang_icons_added(gangster_mind,gang)
return 2
////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -340,13 +361,13 @@

gangster_mind.special_role = null
if(silent < 2)
gangster_mind.current.attack_log += "\[[time_stamp()]\] <font color='red'>Has reformed and defected from the [gang=="A" ? "[gang_name("A")] Gang (A)" : "[gang_name("B")] Gang (B)"]!</font>"
gangster_mind.current.attack_log += "\[[time_stamp()]\] <font color='red'>Has reformed and defected from the [gang_name(gang)] Gang ([gang])!</font>"

if(beingborged)
if(!silent)
gangster_mind.current.visible_message("The frame beeps contentedly from the MMI before initalizing it.")
gangster_mind.current << "<FONT size=3 color=red><B>The frame's firmware detects and deletes your criminal behavior! You are no longer a gangster!</B></FONT>"
message_admins("[key_name_admin(gangster_mind.current)] <A HREF='?_src_=holder;adminmoreinfo=\ref[gangster_mind.current]'>?</A> (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[gangster_mind.current]'>FLW</A>) has been borged while being a member of the [gang=="A" ? "[gang_name("A")] Gang (A)" : "[gang_name("B")] Gang (B)"] Gang. They are no longer a gangster.")
message_admins("[key_name_admin(gangster_mind.current)] <A HREF='?_src_=holder;adminmoreinfo=\ref[gangster_mind.current]'>?</A> (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[gangster_mind.current]'>FLW</A>) has been borged while being a member of the [gang_name(gang)] Gang ([gang]). They are no longer a gangster.")
else
if(!silent)
gangster_mind.current.Paralyse(5)
Expand Down Expand Up @@ -397,7 +418,7 @@
if(!finished)
world << "<FONT size=3 color=red><B>The station was [station_was_nuked ? "destroyed!" : "evacuated before either gang could claim it!"]</B></FONT>"
else
world << "<FONT size=3 color=red><B>The [finished=="A" ? gang_name("A") : gang_name("B")] Gang successfully performed a hostile takeover of the station!!</B></FONT>"
world << "<FONT size=3 color=red><B>The [get_gang_bosses(finished)] Gang successfully performed a hostile takeover of the station!!</B></FONT>"
..()
return 1

Expand Down
61 changes: 56 additions & 5 deletions code/game/gamemodes/gang/gang_pen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
var/cooldown

/obj/item/weapon/pen/gang/attack(mob/living/M, mob/user)
if(!istype(M)) return
if(..(M,user,1))
if(ishuman(M) && ishuman(user) && M.stat != DEAD)
if(user.mind && ((user.mind in ticker.mode.A_bosses) || (user.mind in ticker.mode.B_bosses)))
if(!istype(M))
return
if(ishuman(M) && ishuman(user) && M.stat != DEAD)
if(user.mind && ((user.mind in ticker.mode.A_bosses) || (user.mind in ticker.mode.B_bosses)))
if(..(M,user,1))
if(cooldown)
user << "<span class='warning'>[src] needs more time to recharge before it can be used.</span>"
return
Expand All @@ -35,6 +36,8 @@
user << "<span class='warning'>This mind is resistant to recruitment!</span>"
else
user << "<span class='warning'>This mind has already been recruited into a gang!</span>"
return
..()

/obj/item/weapon/pen/gang/proc/cooldown(modifier)
cooldown = 1
Expand All @@ -43,4 +46,52 @@
cooldown = 0
icon_state = "pen"
var/mob/M = get(src, /mob)
M << "<span class='notice'>\icon[src] [src][(src.loc == M)?(""):(" in your [src.loc]")] vibrates softly.</span>"
M << "<span class='notice'>\icon[src] [src][(src.loc == M)?(""):(" in your [src.loc]")] vibrates softly.</span>"


//////////////
// IMPLANTS //
//////////////

/obj/item/weapon/implant/gang
name = "gang implant"
desc = "Makes you a gangster or such."
activated = 0
var/gang

/obj/item/weapon/implant/gang/New(loc,var/setgang)
..()
gang = setgang

/obj/item/weapon/implant/gang/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
<b>Name:</b> Criminal Loyalty Implant<BR>
<b>Life:</b> A few seconds after injection.<BR>
<b>Important Notes:</b> Illegal<BR>
<HR>
<b>Implant Details:</b><BR>
<b>Function:</b> Contains a small pod of nanobots that change the host's brain to be loyal to a certain organization.<BR>
<b>Special Features:</b> This device will also emit a small EMP pulse, destroying any other implants within the host's brain.<BR>
<b>Integrity:</b> Implant's EMP function will destroy itself in the process."}
return dat

/obj/item/weapon/implant/gang/implanted(mob/target)
..()
for(var/obj/item/weapon/implant/I in target)
if(I != src)
qdel(I)

ticker.mode.remove_gangster(target.mind,0,1,1)
if(ticker.mode.add_gangster(target.mind,gang))
target.Paralyse(5)
else
target.visible_message("<span class='warning'>[target] seems to resist the implant!</span>", "<span class='warning'>You feel the influence of your enemies try to invade your mind!</span>")
qdel(src)

/obj/item/weapon/implanter/gang/New(loc,var/gang)
if(!gang)
qdel(src)
return
imp = new /obj/item/weapon/implant/gang(src,gang)
..()
update_icon()
Loading

0 comments on commit ce02df7

Please sign in to comment.