From 7b02a11dc29658d6ea0c14d2a09ecbdcbb6edba0 Mon Sep 17 00:00:00 2001 From: Ikarrus Date: Sat, 25 Apr 2015 01:20:04 -0600 Subject: [PATCH 1/5] Gang Update 5 ###Major Changes### - Influence income changed to provide weaker gangs a bigger boost, while slowing down stronger gangs to promote opportunity for comebacks - Gangs only earn influence on territories they have held on to since the previous Status Report (the income calculation every 5 minutes). This places more significance on defending your existing territory. - Victory conditions are only checked during Status Reports. - Bosses no longer receive territory updates real-time. They now get them all as a list of new and lost territories in the Status Update. ###Minor Changes### - Goal is now a coeff var so it can be modified in-game for debugging/playtesting purposes - Simplified some list checks for gang - Trying to tag an invalid area will just error out and return, instead of the ganger spraying regular grafiti and confusing people --- code/game/gamemodes/gang/gang.dm | 130 +++++++++++++----- code/game/objects/effects/decals/crayon.dm | 24 ++-- code/game/objects/items/devices/recaller.dm | 19 +-- code/game/objects/items/toys.dm | 33 +++-- .../objects/items/weapons/implants/implant.dm | 4 +- 5 files changed, 133 insertions(+), 77 deletions(-) diff --git a/code/game/gamemodes/gang/gang.dm b/code/game/gamemodes/gang/gang.dm index cfd7f03d89c..15d91bc02a8 100644 --- a/code/game/gamemodes/gang/gang.dm +++ b/code/game/gamemodes/gang/gang.dm @@ -11,6 +11,10 @@ var/datum/gang_points/gang_points var/list/A_territory = list() var/list/B_territory = list() + var/list/A_territory_new = list() + var/list/A_territory_lost = list() + var/list/B_territory_new = list() + var/list/B_territory_lost = list() /datum/game_mode/gang name = "gang war" @@ -21,15 +25,15 @@ required_enemies = 2 recommended_enemies = 2 enemy_minimum_age = 14 - var/finished = 0 - var/checkwin_counter = 0 + var/goal_coeff = 3 //Goal = Total territories / goal_coeff + /////////////////////////// //Announces the game type// /////////////////////////// /datum/game_mode/gang/announce() world << "The current game mode is - Gang War!" - world << "A violent turf war has erupted on the station!
Gangsters - Take over the station by claiming more than 66% of the station!
Crew - The gangs will try to keep you on the station. Successfully evacuate the station to win!
" + world << "A violent turf war has erupted on the station!
Gangsters - Take over the station by claiming more than [round(100/goal_coeff,1)]% of the station!
Crew - The gangs will try to keep you on the station. Successfully evacuate the station to win!
" /////////////////////////////////////////////////////////////////////////////// @@ -74,15 +78,6 @@ modePlayer += B_bosses ..() - -/datum/game_mode/gang/process() - checkwin_counter++ - if(checkwin_counter >= 5) - if(!finished) - ticker.mode.check_win() - checkwin_counter = 0 - return 0 - /datum/game_mode/gang/proc/assign_bosses() var/datum/mind/boss = pick(antag_candidates) A_bosses += boss @@ -99,7 +94,7 @@ /datum/game_mode/proc/forge_gang_objectives(var/datum/mind/boss_mind) var/datum/objective/rival_obj = new rival_obj.owner = boss_mind - rival_obj.explanation_text = "Claim more than 66% the station before the [(boss_mind in A_bosses) ? gang_name("B") : gang_name("A")] Gang does." + rival_obj.explanation_text = "Claim more than [round(100/goal_coeff,1)]% the station before the [(boss_mind in A_bosses) ? gang_name("B") : gang_name("A")] Gang does." boss_mind.objectives += rival_obj @@ -167,9 +162,9 @@ //Checks if the either gang have won or not// ///////////////////////////////////////////// /datum/game_mode/gang/check_win() - if(A_territory.len > (start_state.num_territories / 3)) + if(A_territory.len > (start_state.num_territories / goal_coeff)) finished = "A" //Gang A wins - else if(B_territory.len > (start_state.num_territories / 3)) + else if(B_territory.len > (start_state.num_territories / goal_coeff)) finished = "B" //Gang B wins /////////////////////////////// @@ -186,7 +181,7 @@ /datum/game_mode/proc/add_gangster(datum/mind/gangster_mind, var/gang, var/check = 1) if(check && isloyal(gangster_mind.current)) //Check to see if the potential gangster is implanted return 0 - if((gangster_mind in A_bosses) || (gangster_mind in A_gang) || (gangster_mind in B_bosses) || (gangster_mind in B_gang)) + if(gangster_mind in (A_bosses | A_gang | B_bosses | B_gang)) return 0 if(gang == "A") A_gang += gangster_mind @@ -341,9 +336,9 @@ world << text -////////////////////////////////// -//Handles gang points and income// -////////////////////////////////// +////////////////////////////////////////////////////////// +//Handles influence, territories, and the victory checks// +////////////////////////////////////////////////////////// /datum/gang_points var/A = 30 @@ -356,24 +351,94 @@ income() /datum/gang_points/proc/income() - var/A_new = min(100,(A + 10 + min(ticker.mode.A_territory.len,40))) + var/A_added_names = "" + var/B_added_names = "" + var/A_lost_names = "" + var/B_lost_names = "" + + //Process lost territories + for(var/area in ticker.mode.A_territory_lost) + if(A_lost_names == "") + A_lost_names += ":
" + else + A_lost_names += ", " + A_lost_names += "[ticker.mode.A_territory_lost[area]], " + ticker.mode.A_territory -= area + + for(var/area in ticker.mode.B_territory_lost) + if(B_lost_names == "") + B_lost_names += ":
" + else + B_lost_names += ", " + B_lost_names += "[ticker.mode.B_territory_lost[area]], " + ticker.mode.B_territory -= area + + //Calculate and report influence growth + ticker.mode.message_gangtools(ticker.mode.A_tools,"[gang_name("A")] Gang Status Report:") + var/A_new = min(100,A + 15 + min(ticker.mode.A_territory.len, 15) + round(max(ticker.mode.A_territory.len - 15, 0) * 0.5,1)) var/A_message = "" if(A_new != A) - A_message += "Your gang has gained [A_new - A] Influence from their control of [round((ticker.mode.A_territory.len/start_state.num_territories)*100, 1)]% of the station." + A_message += "Your gang has gained [A_new - A] Influence for holding on to [ticker.mode.A_territory.len] territories." if(A_new == 100) A_message += "Maximum influence reached." A = A_new - ticker.mode.message_gangtools(ticker.mode.A_tools,A_message) + ticker.mode.message_gangtools(ticker.mode.A_tools,A_message,0) - var/B_new = min(100,(B + 10 + min(ticker.mode.B_territory.len,40))) + ticker.mode.message_gangtools(ticker.mode.B_tools,"[gang_name("B")] Gang Status Report:") + var/B_new = min(100,B + 15 + min(ticker.mode.B_territory.len, 15) + round(max(ticker.mode.B_territory.len - 15, 0) * 0.5,1)) var/B_message = "" if(B_new != B) - B_message += "Your gang has collected [B_new - B] Influence from their control of [round((ticker.mode.B_territory.len/start_state.num_territories)*100, 1)]% of the station." + B_message += "Your gang has gained [B_new - B] Influence for holding on to [ticker.mode.B_territory.len] territories." if(B_new == 100) B_message += "Maximum influence reached." B = B_new - ticker.mode.message_gangtools(ticker.mode.B_tools,B_message) + ticker.mode.message_gangtools(ticker.mode.B_tools,B_message,0) + + //Remove territories they already own from the buffer, so if they got tagged over, they can still earn income if they tag it back before the next status report + ticker.mode.A_territory_new -= ticker.mode.A_territory + ticker.mode.B_territory_new -= ticker.mode.B_territory + + //Process new territories + for(var/area in ticker.mode.A_territory_new) + if(A_added_names == "") + A_added_names += ":
" + else + A_added_names += ", " + A_added_names += "[ticker.mode.A_territory_new[area]]" + ticker.mode.A_territory += area + + for(var/area in ticker.mode.B_territory_new) + if(B_added_names == "") + B_added_names += ":
" + else + B_added_names += ", " + B_added_names += "[ticker.mode.B_territory_new[area]]" + ticker.mode.B_territory += area + + //Report territory changes + ticker.mode.message_gangtools(ticker.mode.A_tools,"[ticker.mode.A_territory_new.len] new territories[A_added_names]",0) + ticker.mode.message_gangtools(ticker.mode.B_tools,"[ticker.mode.B_territory_new.len] new territories[B_added_names]",0,) + ticker.mode.message_gangtools(ticker.mode.A_tools,"[ticker.mode.A_territory_lost.len] territories lost[A_lost_names]",0,1) + ticker.mode.message_gangtools(ticker.mode.B_tools,"[ticker.mode.B_territory_lost.len] territories lost[B_lost_names]",0,1) + + //Clear the lists + ticker.mode.A_territory_new = list() + ticker.mode.B_territory_new = list() + ticker.mode.A_territory_lost = list() + ticker.mode.B_territory_lost = list() + + var/A_control = round((ticker.mode.A_territory.len/start_state.num_territories)*100, 1) + var/B_control = round((ticker.mode.B_territory.len/start_state.num_territories)*100, 1) + ticker.mode.message_gangtools((ticker.mode.A_tools),"Your gang now has [A_control]% control of the station.",0) + ticker.mode.message_gangtools((ticker.mode.A_tools),"The [gang_name("B")] Gang has [B_control]% control of the station.",0,1) + ticker.mode.message_gangtools((ticker.mode.B_tools),"Your gang now has [B_control]% control of the station.",0) + ticker.mode.message_gangtools((ticker.mode.B_tools),"The [gang_name("A")] Gang has [A_control]% control of the station.",0,1) + + //Victory check + ticker.mode.check_win() + + //Restart the counter start() @@ -381,14 +446,13 @@ //Sends a message to the boss via his gangtool// //////////////////////////////////////////////// -/datum/game_mode/proc/message_gangtools(var/list/gangtools,var/message,var/priority=2) //0 Territories Gained | 1 Territories lost | 2 Beep! +/datum/game_mode/proc/message_gangtools(var/list/gangtools,var/message,var/beep=1,var/warning) if(!gangtools.len || !message) return for(var/obj/item/device/gangtool/tool in gangtools) - if(tool.ignore_messages <= priority) - var/mob/living/mob = get(tool.loc,/mob/living) - if(mob && mob.mind) - if(((tool.gang == "A") && ((mob.mind in A_gang) || (mob.mind in A_bosses))) || ((tool.gang == "B") && ((mob.mind in B_gang) || (mob.mind in B_bosses)))) - mob << "\icon[tool] [message]" - if(priority>=2) - playsound(mob.loc, 'sound/machines/twobeep.ogg', 50, 1) \ No newline at end of file + var/mob/living/mob = get(tool.loc,/mob/living) + if(mob && mob.mind) + if(((tool.gang == "A") && ((mob.mind in A_gang) || (mob.mind in A_bosses))) || ((tool.gang == "B") && ((mob.mind in B_gang) || (mob.mind in B_bosses)))) + mob << "\icon[tool] [message]" + if(beep) + playsound(mob.loc, 'sound/machines/twobeep.ogg', 50, 1) \ No newline at end of file diff --git a/code/game/objects/effects/decals/crayon.dm b/code/game/objects/effects/decals/crayon.dm index 424467798e9..0274f24aa21 100644 --- a/code/game/objects/effects/decals/crayon.dm +++ b/code/game/objects/effects/decals/crayon.dm @@ -35,38 +35,30 @@ qdel(src) var/area/territory = get_area(location) - var/list/recipients = list() var/color if(type == "A") gang = type color = "#00b4ff" icon_state = gang_name("A") - recipients = ticker.mode.A_tools - ticker.mode.A_territory |= territory.type + ticker.mode.A_territory_new |= list(territory.type = territory.name) + ticker.mode.A_territory_lost -= territory.type else if(type == "B") gang = type color = "#ff3232" icon_state = gang_name("B") - recipients = ticker.mode.B_tools - ticker.mode.B_territory |= territory.type - - if(recipients.len) - ticker.mode.message_gangtools(recipients,"New territory claimed: [territory]",0) + ticker.mode.B_territory_new |= list(territory.type = territory.name) + ticker.mode.B_territory_lost -= territory.type ..(location, color, icon_state, e_name, rotation) /obj/effect/decal/cleanable/crayon/gang/Destroy() var/area/territory = get_area(src) - var/list/recipients = list() if(gang == "A") - recipients += ticker.mode.A_tools - ticker.mode.A_territory -= territory.type + ticker.mode.A_territory_new -= territory.type + ticker.mode.A_territory_lost |= list(territory.type = territory.name) if(gang == "B") - recipients += ticker.mode.B_tools - ticker.mode.B_territory -= territory.type - if(recipients.len) - ticker.mode.message_gangtools(recipients,"Territory lost: [territory]",1) - + ticker.mode.B_territory_new -= territory.type + ticker.mode.B_territory_lost |= list(territory.type = territory.name) ..() \ No newline at end of file diff --git a/code/game/objects/items/devices/recaller.dm b/code/game/objects/items/devices/recaller.dm index f1f7e30e92f..ed4750d62fa 100644 --- a/code/game/objects/items/devices/recaller.dm +++ b/code/game/objects/items/devices/recaller.dm @@ -12,7 +12,6 @@ var/gang //Which gang uses this? var/boss = 1 //If it has the power to promote gang members var/recalling = 0 - var/ignore_messages = 0 var/promotion_cost = 20 /obj/item/device/gangtool/New() //Initialize supply point income if it hasn't already been started @@ -29,7 +28,7 @@ var/dat if(!gang) dat += "This device is not registered.
" - if((user.mind in ticker.mode.B_bosses) || (user.mind in ticker.mode.A_bosses)) + if(user.mind in (ticker.mode.A_bosses | ticker.mode.B_bosses)) dat += "Give this device to another member of your organization to use.
" else dat += "Register Device
" @@ -40,13 +39,7 @@ dat += "Registration: [(gang == "A")? gang_name("A") : gang_name("B")] Gang [boss ? "Administrator" : "Member"]
" dat += "Organization Size: [gang_size]
" - dat += "Territories Controlled: [round((gang_territory/start_state.num_territories)*100, 1)]% of [station_name()]
" - var/alert = "Recieve all alerts" - if(ignore_messages == 1) - alert = "Ignore territories gained" - else if(ignore_messages == 2) - alert = "Ignore territories gained and lost" - dat += "Message Setting: [alert]
" + dat += "Station Control: [round((gang_territory/start_state.num_territories)*100, 1)]%
" dat += "Recall Emergency Shuttle
" dat += "
" dat += "Influence: [points]
" @@ -142,10 +135,6 @@ else if(href_list["choice"]) switch(href_list["choice"]) - if("ignore") - ignore_messages++ - if(ignore_messages>2) - ignore_messages = 0 if("recall") recall(usr) if("register") @@ -155,7 +144,7 @@ /obj/item/device/gangtool/proc/register_device(var/mob/user) var/promoted - if((user.mind in ticker.mode.A_gang) || (user.mind in ticker.mode.A_bosses)) + if(user.mind in (ticker.mode.A_gang | ticker.mode.A_bosses)) ticker.mode.A_tools += src gang = "A" if(!(user.mind in ticker.mode.A_bosses)) @@ -165,7 +154,7 @@ ticker.mode.update_gang_icons_added(user.mind, "A") log_game("[key_name(user)] has been promoted to Lieutenant in the [gang_name("A")] Gang (A)") promoted = 1 - else if((user.mind in ticker.mode.B_gang) || (user.mind in ticker.mode.B_bosses)) + else if(user.mind in (ticker.mode.B_gang | ticker.mode.B_bosses)) ticker.mode.B_tools += src gang = "B" if(!(user.mind in ticker.mode.B_bosses)) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 6c7524e0089..4e44a4c0b7b 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -413,22 +413,33 @@ var/gangID if(gang) //Determine gang affiliation - if((user.mind in ticker.mode.A_bosses) || (user.mind in ticker.mode.A_gang)) + if(user.mind in (ticker.mode.A_bosses | ticker.mode.A_gang)) temp = "[gang_name("A")] gang tag" gangID = "A" - else if((user.mind in ticker.mode.B_bosses) || (user.mind in ticker.mode.B_gang)) + else if(user.mind in (ticker.mode.B_bosses | ticker.mode.B_gang)) temp = "[gang_name("B")] gang tag" gangID = "B" //Check area validity. Reject space, player-created areas, and non-station z-levels. - territory = get_area(target) - if (gangID && territory && (territory.z == ZLEVEL_STATION) && territory.valid_territory) - //Check if this area is already tagged by a gang - if(!(locate(/obj/effect/decal/cleanable/crayon/gang) in target)) //Ignore the check if the tile being sprayed has a gang tag - if(territory_claimed(territory, user)) + if (gangID) + var/area/user_area = get_area(user.loc) + territory = get_area(target) + if(territory && (territory.z == ZLEVEL_STATION) && territory.valid_territory) + //Prevent people spraying from outside of the territory (ie. Maint walls) + if(istype(user_area) && (user_area.type == territory.type)) + //Check if this area is already tagged by a gang + if(!(locate(/obj/effect/decal/cleanable/crayon/gang) in target)) //Ignore the check if the tile being sprayed has a gang tag + if(territory_claimed(territory, user)) + return + if((locate(/obj/machinery/power/terminal) in target) || (locate(/obj/machinery/power/terminal) in user.loc)) + user << "You cannot tag here." + return + else + user << "You cannot tag [territory] from the outside." return - else - user << "This area is unsuitable for territory tagging!" + else + user << "[territory] is unsuitable for territory tagging." + return ///////////////////////////////////////// var/graf_rot @@ -486,9 +497,9 @@ /obj/item/toy/crayon/proc/territory_claimed(var/area/territory,mob/user) var/occupying_gang - if(territory.type in ticker.mode.A_territory) + if(territory.type in (ticker.mode.A_territory | ticker.mode.A_territory_new)) occupying_gang = gang_name("A") - if(territory.type in ticker.mode.B_territory) + if(territory.type in (ticker.mode.B_territory | ticker.mode.B_territory_new)) occupying_gang = gang_name("B") if(occupying_gang) user << "[territory] has already been tagged by the [occupying_gang] gang! You must get rid of or spray over the old tag first!" diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index bedf0ebe085..ede7ae576c6 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -173,10 +173,10 @@ /obj/item/weapon/implant/loyalty/implanted(mob/target) ..() - if((target.mind in ticker.mode.head_revolutionaries) || (target.mind in ticker.mode.A_bosses) || (target.mind in ticker.mode.B_bosses) || is_shadow_or_thrall(target)) + if((target.mind in (ticker.mode.head_revolutionaries | ticker.mode.A_bosses | ticker.mode.B_bosses)) || is_shadow_or_thrall(target)) target.visible_message("[target] seems to resist the implant!", "You feel the corporate tendrils of Nanotrasen try to invade your mind!") return 0 - if((target.mind in ticker.mode.revolutionaries) || (target.mind in ticker.mode.A_gang) || (target.mind in ticker.mode.B_gang)) + if(target.mind in (ticker.mode.revolutionaries | ticker.mode.A_gang | ticker.mode.B_gang)) ticker.mode.remove_revolutionary(target.mind) ticker.mode.remove_gangster(target.mind, exclude_bosses=0) target << "You feel a surge of loyalty towards Nanotrasen." From 452bae9c1914fdd90cb06025a5806c67ad6ef6b6 Mon Sep 17 00:00:00 2001 From: Ikarrus Date: Sat, 25 Apr 2015 01:30:21 -0600 Subject: [PATCH 2/5] - Capture goal reduced to 60% - You must be in the territory physically to tag it now. So no more tagging everything from maint. - Influence income changed to provide weaker gangs a bigger boost, while slowing down stronger gangs to promote opportunity for comebacks - Gangs only earn influence on territories they have held on to since the previous Status Report (the income calculation every 5 minutes). This places more significance on defending your existing territory. - Removed solars and shuttles, and the toxins test chamber from valid territory list - Victory conditions are only checked during Status Reports. - Bosses no longer receive territory updates real-time. They now get them all as a list of new and lost territories in the Status Update. - You cannot tag tiles with APCs. No cheating, you maint crawlers. - Goal is now a coeff var so it can be modified in-game for debugging/playtesting purposes - Simplified some list checks for gang - Trying to tag an invalid area will just error out and return, instead of the ganger spraying regular grafiti and confusing them --- code/game/area/Space Station 13 areas.dm | 3 +++ code/game/gamemodes/gang/gang.dm | 10 +++++----- code/game/objects/items/toys.dm | 12 ++++++------ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index da4a45d31b9..2ab48980639 100644 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -125,6 +125,7 @@ proc/process_ghost_teleport_locs() luminosity = 1 lighting_use_dynamic = 1 has_gravity = 1 + valid_territory = 0 /area/start @@ -658,6 +659,7 @@ proc/process_ghost_teleport_locs() requires_power = 0 luminosity = 1 lighting_use_dynamic = 0 + valid_territory = 0 auxport name = "\improper Fore Port Solar Array" @@ -966,6 +968,7 @@ proc/process_ghost_teleport_locs() icon_state = "toxmisc" /area/toxins/test_area + valid_territory = 0 name = "\improper Toxins Test Area" icon_state = "toxtest" diff --git a/code/game/gamemodes/gang/gang.dm b/code/game/gamemodes/gang/gang.dm index 15d91bc02a8..4b5fed604e8 100644 --- a/code/game/gamemodes/gang/gang.dm +++ b/code/game/gamemodes/gang/gang.dm @@ -26,14 +26,14 @@ recommended_enemies = 2 enemy_minimum_age = 14 var/finished = 0 - var/goal_coeff = 3 //Goal = Total territories / goal_coeff + var/goal_scalar = 0.6 //Goal = Total territories x goal_scalar /////////////////////////// //Announces the game type// /////////////////////////// /datum/game_mode/gang/announce() world << "The current game mode is - Gang War!" - world << "A violent turf war has erupted on the station!
Gangsters - Take over the station by claiming more than [round(100/goal_coeff,1)]% of the station!
Crew - The gangs will try to keep you on the station. Successfully evacuate the station to win!
" + world << "A violent turf war has erupted on the station!
Gangsters - Take over the station by claiming more than [round(100*goal_scalar,1)]% of the station!
Crew - The gangs will try to keep you on the station. Successfully evacuate the station to win!
" /////////////////////////////////////////////////////////////////////////////// @@ -94,7 +94,7 @@ /datum/game_mode/proc/forge_gang_objectives(var/datum/mind/boss_mind) var/datum/objective/rival_obj = new rival_obj.owner = boss_mind - rival_obj.explanation_text = "Claim more than [round(100/goal_coeff,1)]% the station before the [(boss_mind in A_bosses) ? gang_name("B") : gang_name("A")] Gang does." + rival_obj.explanation_text = "Claim more than 60% the station before the [(boss_mind in A_bosses) ? gang_name("B") : gang_name("A")] Gang does." boss_mind.objectives += rival_obj @@ -162,9 +162,9 @@ //Checks if the either gang have won or not// ///////////////////////////////////////////// /datum/game_mode/gang/check_win() - if(A_territory.len > (start_state.num_territories / goal_coeff)) + if(A_territory.len > (start_state.num_territories * goal_scalar)) finished = "A" //Gang A wins - else if(B_territory.len > (start_state.num_territories / goal_coeff)) + else if(B_territory.len > (start_state.num_territories * goal_scalar)) finished = "B" //Gang B wins /////////////////////////////// diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 4e44a4c0b7b..ccadfcb0e01 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -425,20 +425,20 @@ var/area/user_area = get_area(user.loc) territory = get_area(target) if(territory && (territory.z == ZLEVEL_STATION) && territory.valid_territory) + //Check if this area is already tagged by a gang + if(!(locate(/obj/effect/decal/cleanable/crayon/gang) in target)) //Ignore the check if the tile being sprayed has a gang tag + if(territory_claimed(territory, user)) + return //Prevent people spraying from outside of the territory (ie. Maint walls) if(istype(user_area) && (user_area.type == territory.type)) - //Check if this area is already tagged by a gang - if(!(locate(/obj/effect/decal/cleanable/crayon/gang) in target)) //Ignore the check if the tile being sprayed has a gang tag - if(territory_claimed(territory, user)) - return - if((locate(/obj/machinery/power/terminal) in target) || (locate(/obj/machinery/power/terminal) in user.loc)) + if((locate(/obj/machinery/power/terminal) in target) || (locate(/obj/machinery/power/apc) in (user.loc.contents | target.contents))) user << "You cannot tag here." return else user << "You cannot tag [territory] from the outside." return else - user << "[territory] is unsuitable for territory tagging." + user << "[territory] is unsuitable for tagging." return ///////////////////////////////////////// From 4d5e1cae9b91e64be155dc196dfab335149f1e74 Mon Sep 17 00:00:00 2001 From: Ikarrus Date: Sat, 25 Apr 2015 02:28:46 -0600 Subject: [PATCH 3/5] Changelog --- html/changelogs/Ikarrus-gang5.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 html/changelogs/Ikarrus-gang5.yml diff --git a/html/changelogs/Ikarrus-gang5.yml b/html/changelogs/Ikarrus-gang5.yml new file mode 100644 index 00000000000..736b69fba17 --- /dev/null +++ b/html/changelogs/Ikarrus-gang5.yml @@ -0,0 +1,9 @@ +author: Ikarrus + +delete-after: True + +changes: + - tweak: "Gangs Capture goal reduced to 60%" + - tweak: "Influence income changed to provide weaker gangs a bigger boost, while slowing down stronger gangs to promote opportunity for comebacks." + - tweak: "Gangs only earn influence on territories they have held on to since the previous Status Report (the income calculation every 5 minutes). This places more significance on defending your existing territory." + - bugfix: "You must be in the territory physically to tag it now. So no more tagging everything from maint." \ No newline at end of file From e26695b7dbf4cdf8c2228f19b00688081e359650 Mon Sep 17 00:00:00 2001 From: Ikarrus Date: Sat, 25 Apr 2015 02:36:59 -0600 Subject: [PATCH 4/5] Removed unnecessary check --- code/game/objects/items/toys.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index ccadfcb0e01..0184a1265e8 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -431,7 +431,7 @@ return //Prevent people spraying from outside of the territory (ie. Maint walls) if(istype(user_area) && (user_area.type == territory.type)) - if((locate(/obj/machinery/power/terminal) in target) || (locate(/obj/machinery/power/apc) in (user.loc.contents | target.contents))) + if(locate(/obj/machinery/power/apc) in (user.loc.contents | target.contents)) user << "You cannot tag here." return else From a46d79245c035d805f76d0e146677afd984d9dad Mon Sep 17 00:00:00 2001 From: Ikarrus Date: Sat, 25 Apr 2015 10:59:25 -0600 Subject: [PATCH 5/5] Squashed commits. You can see what they do in the first commit/PR desc --- code/__HELPERS/names.dm | 2 +- code/game/objects/effects/decals/crayon.dm | 3 +++ code/game/objects/items/crayons.dm | 4 ++-- code/game/objects/items/toys.dm | 24 +++++++++++++--------- html/changelogs/Ikarrus-gang5.yml | 1 + 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/code/__HELPERS/names.dm b/code/__HELPERS/names.dm index 50f981a3b04..fecd159e8d9 100644 --- a/code/__HELPERS/names.dm +++ b/code/__HELPERS/names.dm @@ -131,11 +131,11 @@ var/syndicate_name = null syndicate_name = name return name +var/gang_name_pool = list("Clandestine", "Prima", "Blue", "Zero-G", "Max", "Blasto", "Waffle", "North", "Omni", "Newton", "Cyber", "Donk", "Gene", "Gib", "Tunnel") var/gang_A_name = null var/gang_B_name = null /proc/gang_name(var/gang) if(!gang_A_name || !gang_B_name) - var/gang_name_pool = list("Clandestine", "Prima", "Blue", "Zero-G", "Max", "Blasto", "Waffle", "North", "Omni", "Newton", "Cyber", "Donk", "Gene", "Gib", "Tunnel") gang_A_name = pick(gang_name_pool) gang_name_pool -= gang_A_name gang_B_name = pick(gang_name_pool) diff --git a/code/game/objects/effects/decals/crayon.dm b/code/game/objects/effects/decals/crayon.dm index 0274f24aa21..8aca6f11748 100644 --- a/code/game/objects/effects/decals/crayon.dm +++ b/code/game/objects/effects/decals/crayon.dm @@ -18,6 +18,9 @@ name = e_name desc = "A [name] drawn in crayon." + if(type == "poseur tag") + gang_name() //Generate gang names so they get removed from the pool + type = pick(gang_name_pool) icon_state = type var/matrix/M = matrix() diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 9706838b9a0..2013d180b59 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -133,7 +133,6 @@ if(iscarbon(target)) if(uses) playsound(user.loc, 'sound/effects/spray.ogg', 5, 1, 5) - uses = max(0,uses-10) var/mob/living/carbon/human/C = target user.visible_message("[user] sprays [src] into the face of [target]!") target << "[user] sprays [src] into your face!" @@ -146,6 +145,7 @@ C.lip_style = "spray_face" C.lip_color = colour C.update_body() + uses = max(0,uses-10) ..() /obj/item/toy/crayon/spraycan/update_icon() @@ -159,4 +159,4 @@ icon_state = "spraycan_gang_cap" gang = 1 uses = 15 - instant = -1 + instant = -1 diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 0184a1265e8..07fe7a7defc 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -320,7 +320,7 @@ attack_verb = list("attacked", "coloured") var/colour = "#FF0000" //RGB var/drawtype = "rune" - var/list/graffiti = list("amyjon","face","matt","revolution","engie","guy","end","dwarf","uboa","body","cyka","arrow") + var/list/graffiti = list("amyjon","face","matt","revolution","engie","guy","end","dwarf","uboa","body","cyka","arrow","poseur tag") var/list/letters = list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z") var/list/oriented = list("arrow","body") // These turn to face the same way as the drawer var/uses = 30 //0 for unlimited uses @@ -399,6 +399,11 @@ /obj/item/toy/crayon/afterattack(atom/target, mob/user as mob, proximity) if(!proximity) return + if(!uses) + user << "There is no more of [src.name] left!" + if(!instant) + qdel(src) + return if(istype(target, /obj/effect/decal/cleanable)) target = target.loc if(is_type_in_list(target,validSurfaces)) @@ -476,10 +481,10 @@ user << "You finish [instant ? "spraying" : "drawing"] [temp]." if(instant<0) playsound(user.loc, 'sound/effects/spray.ogg', 5, 1, 5) - if(uses) - uses-- - if(!uses) - user << "You used up your [src.name]!" + uses = max(0,uses-1) + if(!uses) + user << "There is no more of [src.name] left!" + if(!instant) qdel(src) return @@ -487,11 +492,10 @@ if(edible && (M == user)) user << "You take a bite of the [src.name]. Delicious!" user.nutrition += 5 - if(uses) - uses -= 5 - if(uses <= 0) - user << "There is no more of [src.name] left!" - qdel(src) + uses = max(0,uses-5) + if(!uses) + user << "There is no more of [src.name] left!" + qdel(src) else ..() diff --git a/html/changelogs/Ikarrus-gang5.yml b/html/changelogs/Ikarrus-gang5.yml index 736b69fba17..9716bc9d8a5 100644 --- a/html/changelogs/Ikarrus-gang5.yml +++ b/html/changelogs/Ikarrus-gang5.yml @@ -3,6 +3,7 @@ author: Ikarrus delete-after: True changes: + - rscadd: "Spraycans and crayons can now draw Poseur Tags, aka Fake Gang Tags, as grafiti." - tweak: "Gangs Capture goal reduced to 60%" - tweak: "Influence income changed to provide weaker gangs a bigger boost, while slowing down stronger gangs to promote opportunity for comebacks." - tweak: "Gangs only earn influence on territories they have held on to since the previous Status Report (the income calculation every 5 minutes). This places more significance on defending your existing territory."