Skip to content

Commit

Permalink
marco polo bridge map
Browse files Browse the repository at this point in the history
jobs and assets adjusted for bug fixes
  • Loading branch information
KanohaShinobi committed Nov 30, 2023
1 parent 02823a5 commit 5ef0bd4
Show file tree
Hide file tree
Showing 9 changed files with 432 additions and 165 deletions.
3 changes: 2 additions & 1 deletion civ13.dme
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@
#include "code\game\objects\map_metadata\little_creek_tdm.dm"
#include "code\game\objects\map_metadata\long_march.dm"
#include "code\game\objects\map_metadata\magistral.dm"
#include "code\game\objects\map_metadata\marco_polo_bridge.dm"
#include "code\game\objects\map_metadata\missionary_ridge.dm"
#include "code\game\objects\map_metadata\moscow194.dm"
#include "code\game\objects\map_metadata\nanjing.dm"
Expand Down Expand Up @@ -1105,5 +1106,5 @@
#include "code\processes\lighting\sources.dm"
#include "interface\interface.dm"
#include "interface\skin.dmf"
#include "maps\1943\khalkhyn_gol.dmm"
#include "maps\1943\marco_polo_bridge.dmm"
// END_INCLUDE
4 changes: 3 additions & 1 deletion code/__defines/maps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
#define MAP_IWO_JIMA "IWO_JIMA"
#define MAP_RIZAL_STADIUM "RIZAL_STADIUM"
#define MAP_INTRAMUROS "INTRAMUROS"
#define MAP_LUGOU
#define MAP_WAKE_ISLAND "WAKE_ISLAND"
#define MAP_NANKOU "NANKOU"
#define MAP_FOREST "FOREST"
Expand Down Expand Up @@ -167,3 +166,6 @@
#define MAP_RED_MENACE "RED_MENACE"
#define MAP_PAPERS_PLEASE "PAPERS_PLEASE"
#define MAP_TWOTRIBES "TWOTRIBES"


#define MAP_MARCO_POLO_BRIDGE "MARCO_POLO_BRIDGE"
5 changes: 3 additions & 2 deletions code/game/objects/items/weapons/storage/backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@
new /obj/item/clothing/head/helmet/ww2/japhelm(src)
new /obj/item/weapon/grenade/ww2/type97(src)
new /obj/item/weapon/grenade/ww2/type97(src)
new /obj/item/weapon/can/filled/JPNMRE(src)
new /obj/item/weapon/can/filled/JPNMRE(src)
new /obj/item/weapon/can/JPNMRE(src)
new /obj/item/weapon/can/JPNMRE(src)
new /obj/item/stack/medical/bruise_pack/gauze(src)

/obj/item/weapon/storage/backpack/ww2/jap/ammo_crate
name = "japanese ammo crate"
Expand Down
168 changes: 168 additions & 0 deletions code/game/objects/map_metadata/marco_polo_bridge.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
/obj/map_metadata/marco_polo_bridge
ID = MAP_MARCO_POLO_BRIDGE
title = "Marco Polo Bridge"
lobby_icon = "icons/lobby/china.png"
caribbean_blocking_area_types = list(/area/caribbean/no_mans_land/invisible_wall,/area/caribbean/no_mans_land/invisible_wall/one,/area/caribbean/no_mans_land/invisible_wall/two)
respawn_delay = 0

faction_organization = list(
JAPANESE,
CHINESE)

roundend_condition_sides = list(
list(JAPANESE) = /area/caribbean/island,
list(CHINESE) = /area/caribbean/island,
)
age = "1937"
faction_distribution_coeffs = list(JAPANESE = 0.4, CHINESE = 0.6)
battle_name = "The Marco Polo Birdge Incident"
mission_start_message = "<font size=4>The <b>Imperial Japanese Army</b> and the <b>Kuomintang</b> are battling for the control of Marco Polo Bridge! Each side will win if they manage to hold the <b>central island</b> for <b>4 minutes</b>.<br>The battle will start in <b>4 minutes</b>.</font>"
faction1 = JAPANESE
faction2 = CHINESE
ordinal_age = 6
songs = list(
"Mugi to Heitai:1" = "sound/music/mugi_to_heitai.ogg",
"I Hate These Classes:2" = "sound/music/i_hate_these_classes.ogg")
gamemode = "King of the Hill"
/obj/map_metadata/marco_polo_bridge/faction2_can_cross_blocks()
return (processes.ticker.playtime_elapsed >= 2400 || admin_ended_all_grace_periods)

/obj/map_metadata/marco_polo_bridge/faction1_can_cross_blocks()
return (processes.ticker.playtime_elapsed >= 2400 || admin_ended_all_grace_periods)

/obj/map_metadata/marco_polo_bridge/job_enabled_specialcheck(var/datum/job/J)
..()
if (J.is_prison == TRUE || istype(J, /datum/job/japanese/ija_ww2ATunit) || J.is_pacific == TRUE || J.is_navy == TRUE || J.is_tanker == TRUE)
. = FALSE
else if (J.is_ww2 == TRUE)
. = TRUE
else if (istype(J, /datum/job/chinese/captain) || istype(J, /datum/job/chinese/lieutenant) || istype(J, /datum/job/chinese/sergeant) || istype(J, /datum/job/chinese/doctor) || istype(J, /datum/job/chinese/infantry) || istype(J, /datum/job/chinese/sniper))
. = TRUE
else
. = FALSE

/obj/map_metadata/marco_polo_bridge/short_win_time(faction)
if (!(alive_n_of_side(faction1)) || !(alive_n_of_side(faction2)))
return 2400
else
return 2400 // 4 minutes

/obj/map_metadata/marco_polo_bridge/long_win_time(faction)
if (!(alive_n_of_side(faction1)) || !(alive_n_of_side(faction2)))
return 2400
else
return 2400 // 4 minutes

/obj/map_metadata/marco_polo_bridge/roundend_condition_def2name(define)
..()
switch (define)
if (CHINESE)
return "Chinese"
if (JAPANESE)
return "Japanese"

/obj/map_metadata/marco_polo_bridge/roundend_condition_def2army(define)
..()
switch (define)
if (CHINESE)
return "Chinese Army"
if (JAPANESE)
return "Japanese Army"
/obj/map_metadata/marco_polo_bridge/army2name(army)
..()
switch (army)
if ("Chinese")
return "Chinese"
if ("Japanese")
return "Japanese"

/obj/map_metadata/marco_polo_bridge/cross_message(faction)
if (faction == JAPANESE)
return "<font size = 4>The Japanese may now cross the invisible wall!</font>"
else if (faction == CHINESE)
return "<font size = 4>The Chinese may now cross the invisible wall!</font>"
else
return ""

/obj/map_metadata/marco_polo_bridge/reverse_cross_message(faction)
if (faction == JAPANESE)
return "<span class = 'userdanger'>The Japanese may no longer cross the invisible wall!</span>"
else if (faction == CHINESE)
return "<span class = 'userdanger'>The Chinese may no longer cross the invisible wall!</span>"
else
return ""

/obj/map_metadata/marco_polo_bridge/update_win_condition()

if (world.time >= next_win && next_win != -1)
if (win_condition_spam_check)
return FALSE
ticker.finished = TRUE
var/message = "The [battle_name ? battle_name : "battle"] has ended in a stalemate!"
if (current_winner && current_loser)
message = "The battle is over! The [current_winner] was victorious over the [current_loser][battle_name ? " in the [battle_name]" : ""]!"
world << "<font size = 4><span class = 'notice'>[message]</span></font>"
win_condition_spam_check = TRUE
return FALSE
// German major
else if (win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[2]]), roundend_condition_sides[1], roundend_condition_sides[2], 1.33, TRUE))
if (!win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[1]]), roundend_condition_sides[2], roundend_condition_sides[1], 1.33))
if (last_win_condition != win_condition.hash)
current_win_condition = "The [roundend_condition_def2army(roundend_condition_sides[1][1])] has captured the Island! They will win in {time} minute{s}."
next_win = world.time + short_win_time(roundend_condition_sides[2][1])
announce_current_win_condition()
current_winner = roundend_condition_def2army(roundend_condition_sides[1][1])
current_loser = roundend_condition_def2army(roundend_condition_sides[2][1])
// German minor
else if (win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[2]]), roundend_condition_sides[1], roundend_condition_sides[2], 1.01, TRUE))
if (!win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[1]]), roundend_condition_sides[2], roundend_condition_sides[1], 1.01))
if (last_win_condition != win_condition.hash)
current_win_condition = "The [roundend_condition_def2army(roundend_condition_sides[1][1])] has captured the Island! They will win in {time} minute{s}."
next_win = world.time + long_win_time(roundend_condition_sides[2][1])
announce_current_win_condition()
current_winner = roundend_condition_def2army(roundend_condition_sides[1][1])
current_loser = roundend_condition_def2army(roundend_condition_sides[2][1])
// Soviet major
else if (win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[1]]), roundend_condition_sides[2], roundend_condition_sides[1], 1.33, TRUE))
if (!win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[2]]), roundend_condition_sides[1], roundend_condition_sides[2], 1.33))
if (last_win_condition != win_condition.hash)
current_win_condition = "The [roundend_condition_def2army(roundend_condition_sides[2][1])] has captured the Island! They will win in {time} minute{s}."
next_win = world.time + short_win_time(roundend_condition_sides[1][1])
announce_current_win_condition()
current_winner = roundend_condition_def2army(roundend_condition_sides[2][1])
current_loser = roundend_condition_def2army(roundend_condition_sides[1][1])
// Soviet minor
else if (win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[1]]), roundend_condition_sides[2], roundend_condition_sides[1], 1.01, TRUE))
if (!win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[2]]), roundend_condition_sides[1], roundend_condition_sides[2], 1.01))
if (last_win_condition != win_condition.hash)
current_win_condition = "The [roundend_condition_def2army(roundend_condition_sides[2][1])] has captured the Island! They will win in {time} minute{s}."
next_win = world.time + long_win_time(roundend_condition_sides[1][1])
announce_current_win_condition()
current_winner = roundend_condition_def2army(roundend_condition_sides[2][1])
current_loser = roundend_condition_def2army(roundend_condition_sides[1][1])

else
if (current_win_condition != no_winner && current_winner && current_loser)
world << "<font size = 3>The [current_winner] has lost control of the Island!</font>"
current_winner = null
current_loser = null
next_win = -1
current_win_condition = no_winner
win_condition.hash = 0
last_win_condition = win_condition.hash
return TRUE

/obj/map_metadata/marco_polo_bridge/check_caribbean_block(var/mob/living/human/H, var/turf/T)
if (!istype(H) || !istype(T))
return FALSE
var/area/A = get_area(T)
if (istype(A, /area/caribbean/no_mans_land/invisible_wall))
if (istype(A, /area/caribbean/no_mans_land/invisible_wall/one))
if (H.faction_text == faction1)
return TRUE
else if (istype(A, /area/caribbean/no_mans_land/invisible_wall/two))
if (H.faction_text == faction2)
return TRUE
else
return !faction1_can_cross_blocks()
return FALSE
83 changes: 58 additions & 25 deletions code/modules/1713/jobs/japanese.dm
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
//weapons
H.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/pistol/ww2/nambu(H), slot_l_hand)
if (map.ID == MAP_NANKOU || map.ID == MAP_NANJING)
if (map.ID == MAP_NANKOU || map.ID == MAP_NANJING || map.ID == MAP_MARCO_POLO_BRIDGE)
H.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/boltaction/arisaka38(H), slot_shoulder)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/jap/soldier(H), slot_belt)
else if (map.ID != MAP_NANKOU && map.ID != MAP_NANJING && prob(5))
Expand All @@ -637,6 +637,8 @@
else
H.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/boltaction/arisaka99(H), slot_shoulder)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/jap/ww2soldier(H), slot_belt)
if (map.ID == MAP_MARCO_POLO_BRIDGE)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/ww2/jap/full(H), slot_back)
var/obj/item/clothing/under/uniform = H.w_uniform
var/obj/item/clothing/accessory/storage/sheath/katana/fullh = new /obj/item/clothing/accessory/storage/sheath/katana/full(null)
uniform.attackby(fullh, H)
Expand Down Expand Up @@ -740,7 +742,7 @@
//head
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm_med(H), slot_head)
//back
if (map.ID == MAP_NANKOU || map.ID == MAP_NANJING)
if (map.ID == MAP_NANKOU || map.ID == MAP_NANJING || map.ID == MAP_MARCO_POLO_BRIDGE)
H.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/boltaction/arisaka38(H), slot_shoulder)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/jap/soldier(H), slot_belt)
else
Expand All @@ -749,6 +751,9 @@
//other
H.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/adv(H), slot_l_hand)
H.equip_to_slot_or_del(new /obj/item/weapon/doctor_handbook(H), slot_l_store)
if (map.ID == MAP_MARCO_POLO_BRIDGE)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/ww2/jap/full(H), slot_back)

if (map.ID == MAP_INTRAMUROS)
var/obj/item/weapon/storage/belt/keychain/KC = new/obj/item/weapon/storage/belt/keychain(H)
var/obj/item/weapon/key/japanese/G1 = new/obj/item/weapon/key/japanese(null)
Expand Down Expand Up @@ -796,15 +801,21 @@
H.equip_to_slot_or_del(new /obj/item/clothing/under/ww2/japuni(H), slot_w_uniform)

//head
if (prob(70))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm(H), slot_head)
else if (prob(10))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm/bandana(H), slot_head)
if (map.ID == MAP_MARCO_POLO_BRIDGE)
if (prob(90))
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
else
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japsakurahelm(H), slot_head)
else
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
if (prob(70))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm(H), slot_head)
else if (prob(10))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm/bandana(H), slot_head)
else
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
//back
var/randweap = rand(1,2)
if (map.ID == MAP_NANKOU || map.ID == MAP_NANJING)
if (map.ID == MAP_NANKOU || map.ID == MAP_NANJING || map.ID == MAP_MARCO_POLO_BRIDGE)
H.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/boltaction/arisaka38(H), slot_shoulder)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/jap/soldier(H), slot_belt)
else
Expand All @@ -814,6 +825,8 @@
else if (randweap == 2)
H.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/boltaction/arisaka38(H), slot_shoulder)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/jap/soldier(H), slot_belt)
if (map.ID == MAP_MARCO_POLO_BRIDGE)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/ww2/jap/full(H), slot_back)
give_random_name(H)
if (map.ID == MAP_INTRAMUROS)
var/obj/item/weapon/storage/belt/keychain/KC = new/obj/item/weapon/storage/belt/keychain(H)
Expand Down Expand Up @@ -925,19 +938,27 @@
H.equip_to_slot_or_del(new /obj/item/clothing/under/ww2/japuni(H), slot_w_uniform)

//head
if (prob(70))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm(H), slot_head)
else if (prob(10))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm/bandana(H), slot_head)
if (map.ID == MAP_MARCO_POLO_BRIDGE)
if (prob(90))
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
else
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japsakurahelm(H), slot_head)
else
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
if (prob(70))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm(H), slot_head)
else if (prob(10))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm/bandana(H), slot_head)
else
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
//back
if (map.ID == MAP_NANKOU || map.ID == MAP_NANJING)
if (map.ID == MAP_NANKOU || map.ID == MAP_NANJING || map.ID == MAP_MARCO_POLO_BRIDGE)
H.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/type96(H), slot_shoulder)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/jap/ww2soldier96(H), slot_belt)
else
H.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/type99(H), slot_shoulder)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/jap/ww2soldier99(H), slot_belt)
if (map.ID == MAP_MARCO_POLO_BRIDGE)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/ww2/jap/full(H), slot_back)
give_random_name(H)
H.s_tone = rand(-32,-24)
if (H.f_style != "Shaved" && H.f_style != "Short Facial Hair" && H.f_style != "Goatee")
Expand Down Expand Up @@ -987,14 +1008,20 @@
H.equip_to_slot_or_del(new /obj/item/clothing/under/ww2/japuni(H), slot_w_uniform)

//head
if (prob(70))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm(H), slot_head)
else if (prob(10))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm/bandana(H), slot_head)
if (map.ID == MAP_MARCO_POLO_BRIDGE)
if (prob(90))
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
else
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japsakurahelm(H), slot_head)
else
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
if (prob(70))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm(H), slot_head)
else if (prob(10))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm/bandana(H), slot_head)
else
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
//back
if (map.ID == MAP_NANKOU || map.ID == MAP_NANJING)
if (map.ID == MAP_NANKOU || map.ID == MAP_NANJING || map.ID == MAP_MARCO_POLO_BRIDGE)
H.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/boltaction/arisaka38(H), slot_shoulder)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/jap/soldier(H), slot_belt)
else
Expand Down Expand Up @@ -1051,12 +1078,18 @@
H.equip_to_slot_or_del(new /obj/item/clothing/under/ww2/japuni(H), slot_w_uniform)

//head
if (prob(70))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm(H), slot_head)
else if (prob(10))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm/bandana(H), slot_head)
if (map.ID == MAP_MARCO_POLO_BRIDGE)
if (prob(90))
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
else
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japsakurahelm(H), slot_head)
else
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
if (prob(70))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm(H), slot_head)
else if (prob(10))
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/ww2/japhelm/bandana(H), slot_head)
else
H.equip_to_slot_or_del(new /obj/item/clothing/head/ww2/japcap(H), slot_head)
//back
if (map.ID == MAP_NANKOU || map.ID == MAP_NANJING)
H.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/boltaction/arisaka38/sniper(H), slot_shoulder)
Expand Down
Loading

0 comments on commit 5ef0bd4

Please sign in to comment.