-
Notifications
You must be signed in to change notification settings - Fork 498
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New mid-threat antag: Pirates (#8340)
* Start working on pirates * Add pirate roleset * Continue working on pirates * Add plunder objective * Continue working on pirate stuff * Increase plunder timer * Plunder value scales with number of pirates * Finish cleaning and tuning * 10k to 15k * Properly update explanation * Don't get whole faction inventory * Increase shuttle move time * Add shield diffusers * Shuttle lock system * Slightly shift shuttle to avoid seeing the deges * Update pirate welcome * Hopefully fix pirate comms * Remove useless helmet since they're already in void suits * Oopsies * Remove pirate shuttle docking controller * Add hacked cigarette machine and rum keg * Remove debug message * Make pirate base item worthless * Forgot that for shuttle controller
- Loading branch information
Showing
29 changed files
with
2,437 additions
and
1,120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
//Possible mission states | ||
#define PLUNDER_STATUS_SETUP 0 //Mercs are still at their base getting equipped | ||
#define PLUNDER_STATUS_IN_PROGRESS 1 //Mission has started, timer is ticking | ||
#define PLUNDER_STATUS_ABORTED 2 //Time limit expired, mission failed | ||
#define PLUNDER_STATUS_POSTGAME 3 //Mercs returned to their base. They get half an hour to roleplay and debrief# | ||
#define PLUNDER_STATUS_ENDED 4 //All pirates have been despawned | ||
|
||
/datum/objective/timed/pirate | ||
explanation_text = "Return to your ship and withdraw to base within X minutes." | ||
var/mission_timer = 45 MINUTES | ||
var/mission_status = PLUNDER_STATUS_SETUP | ||
var/ended = FALSE | ||
|
||
/datum/objective/timed/pirate/check_completion() | ||
if (failed) | ||
return FALSE | ||
|
||
var/datum/shuttle/autodock/multi/antag/pirate/MS = SSshuttle.get_shuttle("Pirate") | ||
|
||
if (!MS) | ||
//Shuttle was destroyed? | ||
return FALSE | ||
|
||
|
||
if (MS.current_location != MS.home_waypoint && MS.next_location != MS.home_waypoint) | ||
//The shuttle still near Eris, fail | ||
//This will succeed as long as they're enroute away from eris | ||
return FALSE | ||
|
||
return TRUE | ||
|
||
|
||
/datum/objective/timed/pirate/update_explanation() | ||
explanation_text = "Return to your ship and withdraw to base within [round(mission_timer / (1 MINUTE), 1)] minutes." | ||
|
||
/datum/objective/timed/pirate/get_panel_entry() | ||
return "Withdraw to base within [round(mission_timer / (1 MINUTE), 1)] minutes. Time remaining: [time2text(mission_timer, "mm:ss")]." | ||
|
||
/datum/objective/timed/pirate/get_info() | ||
return "Time remaining at arrival: [time2text(mission_timer, "mm:ss")]." | ||
|
||
/datum/objective/timed/pirate/proc/start_mission() | ||
START_PROCESSING(SSobj, src) | ||
mission_status = PLUNDER_STATUS_IN_PROGRESS | ||
|
||
//The faction datum processes to tick down the mission timer | ||
/datum/objective/timed/pirate/Process() | ||
mission_timer -= 1 SECONDS | ||
if (!ended && mission_timer <= 0) | ||
end_mission() | ||
|
||
/* | ||
The timer keeps ticking even after its ended because later i plan to extend this to let them hang | ||
around the pirate base for up to half an hour and then be despawned so the base can be reset | ||
*/ | ||
|
||
|
||
|
||
//The mission ends when the pirates return to base or their time limit expires | ||
/datum/objective/timed/pirate/proc/end_mission() | ||
ended = TRUE | ||
if (!check_completion()) | ||
abort_mission() | ||
mission_status = PLUNDER_STATUS_ABORTED | ||
else | ||
for (var/datum/objective/O in owner_faction.objectives) | ||
if (O.check_completion()) | ||
O.completed = TRUE | ||
mission_status = PLUNDER_STATUS_POSTGAME | ||
|
||
// Not going back to Eris once mission is over | ||
var/datum/shuttle/autodock/multi/antag/pirate/MS = SSshuttle.get_shuttle("Pirate") | ||
if(MS) | ||
MS.lock_shuttle() | ||
|
||
//This is one of the few times a world << call is actually intended functionality. | ||
//This is not a debug message, it outputs the result of the mission, it should remain in | ||
to_chat(world, owner_faction.print_success()) | ||
|
||
|
||
|
||
//This is called if the pirates' time limit expires while they're not at their base. Mission failure | ||
/datum/objective/timed/pirate/proc/abort_mission() | ||
|
||
//First of all, every pirate left on eris is executed by a little bomb in their skull | ||
for (var/datum/antagonist/A in owner_faction.members) | ||
if (!A || !A.owner) | ||
continue | ||
|
||
var/mob/living/carbon/human/H = A.owner.current | ||
if (!H) | ||
continue | ||
|
||
if (isNotStationLevel(H.z)) | ||
continue | ||
|
||
var/obj/item/organ/external/affecting = H.get_organ(BP_HEAD) | ||
affecting.take_damage(9999) //Headgib. Very dead | ||
|
||
|
||
|
||
//Secondly, fail all mission objectives | ||
for (var/datum/objective/O in owner_faction.objectives) | ||
O.failed = TRUE | ||
|
||
/* | ||
// Thirdly, the pirate ship selfdestructs | ||
var/list/atoms = get_area_contents(/area/shuttle/pirate) | ||
for (var/a in atoms) | ||
qdel(a) | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/datum/objective/plunder | ||
target_amount = 15000 // Cumulated value of loot to plunder | ||
unique = TRUE | ||
|
||
/datum/objective/plunder/New(datum/antagonist/new_owner, datum/mind/_target) | ||
..() | ||
if(owner_faction) | ||
target_amount *= LAZYLEN(owner_faction.members) | ||
update_explanation() | ||
|
||
/datum/objective/plunder/check_completion() | ||
if (failed) | ||
return FALSE | ||
if(owner && (!owner.current || owner.current.stat == DEAD)) | ||
return FALSE | ||
|
||
return (get_loot_value() < target_amount) ? FALSE : TRUE | ||
|
||
/datum/objective/plunder/proc/get_loot_value() | ||
var/list/contents = list() | ||
|
||
// Get inventory of the faction | ||
if (owner_faction) | ||
contents.Add(owner_faction.get_inventory()) | ||
|
||
var/cumulated_amount = 0 | ||
|
||
// Check cumulated loot value | ||
for(var/atom/movable/A in contents) | ||
if(isitem(A)) | ||
var/obj/item/I = A | ||
if(I.item_flags & PIRATE_BASE) // Item spawned in pirate base are worthless for pirates | ||
continue | ||
cumulated_amount += SStrade.get_price(A, TRUE) | ||
|
||
return cumulated_amount | ||
|
||
/datum/objective/plunder/update_explanation() | ||
explanation_text = "Plunder loot with a cumulated value of [target_amount] credits. Loot must be stored on the raid shuttle in a loot crate to be considered toward your objective." | ||
|
||
/datum/objective/plunder/get_panel_entry() | ||
return "Plunder loot with a cumulated value of <a href='?src=\ref[src];set_target=1'>[target_amount]</a> credits. \ | ||
Value of loot: <a href='?src=\ref[src];set_target=1'>[get_loot_value()]</a> credits." | ||
|
||
/datum/objective/plunder/get_info() | ||
return "Value of loot: [get_loot_value()] credits." | ||
|
||
/datum/objective/plunder/Topic(href, href_list) | ||
if(..()) | ||
return TRUE | ||
if(href_list["set_target"]) | ||
var/new_target = input("Input target number:", "Value of loot to plunder", target_amount) as num|null | ||
if(new_target < 1) | ||
return | ||
else | ||
target_amount = new_target | ||
update_explanation() | ||
antag.antagonist_panel() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/decl/hierarchy/outfit/antagonist/pirate | ||
|
||
hierarchy_type = /decl/hierarchy/outfit/antagonist/pirate | ||
|
||
uniform = /obj/item/clothing/under/pirate | ||
l_ear = /obj/item/device/radio/headset/pirates | ||
shoes = /obj/item/clothing/shoes/jackboots | ||
head = /obj/item/clothing/head/bandana | ||
pda_slot = slot_belt | ||
pda_type = /obj/item/modular_computer/pda | ||
|
||
//The outfit that mercs spawn in. They get their armor and weapons from the merc base | ||
/decl/hierarchy/outfit/antagonist/pirate/casual | ||
name = "Pirate garb" | ||
|
||
//He gets a snazzy beret | ||
/decl/hierarchy/outfit/antagonist/pirate/commander | ||
name = "Pirate Quartermaster garb" | ||
glasses = /obj/item/clothing/glasses/eyepatch | ||
head = /obj/item/clothing/head/pirate | ||
|
||
//This outfit is just for admin fun. Spawns them fully equipped | ||
//Actual pirates equip themselves by picking up their garb from their base | ||
/decl/hierarchy/outfit/antagonist/pirate/equipped | ||
name = "Pirate plundering gear" | ||
|
||
suit = /obj/item/clothing/suit/pirate | ||
back = /obj/item/storage/backpack/satchel | ||
belt = /obj/item/melee/energy/sword/pirate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.