Skip to content
This repository was archived by the owner on May 6, 2023. It is now read-only.

Commit 62734e4

Browse files
authored
New pain... erm, functionality (#35)
1 parent ea40c5f commit 62734e4

15 files changed

+295
-20
lines changed

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@
22

33
This mod makes the following changes to the campaign layer of Starsector:
44

5-
1. Weapons and combat ships are scarce and highly regulated. As such, only Military Markets (and those pesky Black
6-
Markets) sell higher tier weapons, LPCs, modspecs, and combat ships. Open Markets still sell civilian grade ships
7-
and low tier combat ships and items.
8-
1. Lawless factions (e.g. pirates and pathers) and independents do not submit to this rule of law. You can still find
9-
high tier weapons and combat ships at their bases (both core and raider).
5+
1. Weapons and combat ships are scarce and highly regulated. As such, only Military Markets (and those pesky Black Markets) will sell higher tier weapons, LPCs, modspecs, and combat ships. Open Markets still sell civilian grade ships and low tier combat ships and items.
6+
1. Lawless factions (e.g. pirates and pathers) and independents do not submit to this rule of law. You can still find high tier weapons and combat ships at their bases (both core and raider).
7+
1. Contraband can happen, and when stability is low, some weapons and ships from Military Market can become "legal".
108
1. There are no pristine ships any more, everything is d-modded. Including your starting fleet.
11-
1. Contraband can happen, and when stability is low, some weapons and ships from Military Market can become "legal".
12-
1. Access to most Black Markets is impossible while legally docked at the station. Speaking of access, you will need to
13-
use a fence who will ask for a cut (displayed as tariff for now).
14-
1. Factions are armed to the teeth. Any non-hidden market has at least an orbiting station, ground defences, and patrol
15-
HQ. Hidden bases (pirates and pathers raider bases) only get ground defences.
16-
1. Your actions have consequences. When defeating a fleet, your reputation with seemingly unrelated factions changes as
17-
well. Enemies of your enemy start to like you a bit, while their friends, less.
18-
1. Similarly, targetting any colony item will be deemed as an act of war.
9+
1. Access to most Black Markets is impossible while legally docked at the station. Speaking of access, you will need to use a fence who will ask for a cut (displayed as tariff for now).
10+
1. Factions are armed to the teeth. Any non-hidden market has at least an orbiting station, ground defences, and patrol HQ. Hidden bases (pirates and pathers raider bases) only get ground defences.
11+
1. Your actions have consequences. When defeating a fleet, your reputation with seemingly unrelated factions changes as well. Enemies of your enemy start to like you a bit, while their friends, less.
12+
1. Similarly, targetting any colony item will be deemed as an act of war.
13+
1. Blueprint packages are no longer lootable. You will have to collect blueprints one by one.
14+
1. And speaking of salvage, everything needs a story point.
15+
1. Finally, a skill is needed to use s-mods at all (no skill = 0 s-mods, with skill = 1 s-mod).
1916

2017
All changes are optional, and can be disabled via `starpocalypse.json`.
2118

@@ -77,3 +74,8 @@ Black Market mechanics are slightly tweaked to make it less of a go-to market fo
7774
Factions that regulate their open markets will not allow you to trade on Black Market.
7875
As such, you will have to illegally dock at those stations (transponder off).
7976
On top of that, a fence fee equal half of the market tariff will be required to pay for any transactions.
77+
78+
### Other changes
79+
80+
On game load, all blueprint packages are given "no drop" tag.
81+
On recovery (salvage or post battle) all recoverable ships are made into story-recoverable (even own lost ships).

assets/mod_info.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
"name": " Starpocalypse",
44
"author": "Jaghaimo",
55
"utility": true,
6-
"version": "2.2.3",
6+
"version": "2.3.0",
77
"description": "More apocalyptic settings",
88
"gameVersion": "0.95.1a-RC6",
99
"modPlugin": "starpocalypse.StarpocalypseMod",
10-
"jars": ["starpocalypse.jar"]
11-
}
10+
"jars": [
11+
"starpocalypse.jar"
12+
]
13+
}

assets/starpocalypse.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
"transparentMarket": true,
2626
# Setting this to 0 essentially disabled the feature. Setting this to 1 makes it behave as if the transponder was on
2727
# for suspicion calculations. Setting it above 1 will cause a penalty for trading with transponder off.
28-
"transparentMarketMult": 0.5,
28+
"transparentMarketMult": 0.5,# vanilla: 0
2929
# Accessing Black Market is only possible with transponder turned off.
3030
"shyBlackMarket": true,
3131
# Black Market handling fee as a fraction of Open Market tariff. If tariff is 30%, Black Market tariff will be 15%.
32-
"blackMarketFenceCut": 0.5,
32+
"blackMarketFenceCut": 0.5,# vanilla: 0
3333

3434
## BETTER MARKET DEFENCES
3535
# Adds a tier 1 station to all non-hidden markets that do not have a station.
@@ -44,4 +44,15 @@
4444
"combatAdjustedReputation": true,
4545
# Raiding for special items instantly ruins player reputation with the owner of the item.
4646
"hostilityForSpecialItemRaid": true,
47+
48+
## OTHER CHANGES
49+
# Do not drop blueprint packages. Player will have to collect blueprints one by one.
50+
"blueprintPackageNoDrop": true,
51+
52+
# Number of s-mods available to player (without skill).
53+
"maximumPermaMods": 0, # easy mode: 1, vanilla: 2
54+
55+
# Remove all ships from salvageable debris fields and always require a story point to recover a ship (both derelict
56+
# ships found across the sector, and post battle recoveries - including own ships).
57+
"stingyRecoveries": true,
4758
}

assets/starpocalypse.version

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"minor": 2,
88
"patch": 3
99
},
10-
"directDownloadURL": "https://github.com/jaghaimo/starpocalypse/releases/download/2.2.3/starpocalypse-2.2.3.zip"
11-
}
10+
"directDownloadURL": "https://github.com/jaghaimo/starpocalypse/releases/download/2.3.0/starpocalypse-2.3.0zip"
11+
}

src/starpocalypse/StarpocalypseMod.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
import com.fs.starfarer.api.fleet.FleetMemberAPI;
77
import com.fs.starfarer.api.impl.campaign.ids.Industries;
88
import com.fs.starfarer.api.impl.campaign.shared.SharedData;
9+
import com.fs.starfarer.api.util.Misc;
910
import java.util.List;
1011
import lombok.extern.log4j.Log4j;
1112
import org.json.JSONObject;
1213
import starpocalypse.helper.ConfigHelper;
14+
import starpocalypse.helper.DropTableUtils;
1315
import starpocalypse.market.IndustryAdder;
1416
import starpocalypse.market.MarketListener;
1517
import starpocalypse.market.StationAdder;
@@ -27,6 +29,8 @@ public class StarpocalypseMod extends BaseModPlugin {
2729
public void onApplicationLoad() throws Exception {
2830
settings = Global.getSettings().loadJSON("starpocalypse.json");
2931
ConfigHelper.init(settings, log);
32+
disableBlueprintDrop();
33+
setMaxPermaMods();
3034
}
3135

3236
@Override
@@ -43,6 +47,7 @@ public void onGameLoad(boolean newGame) {
4347
industryChanges();
4448
combatAdjustedReputation();
4549
hostilityForSpecialItemRaid();
50+
stingyRecoveries();
4651
}
4752

4853
@Override
@@ -114,6 +119,13 @@ private void combatAdjustedReputation() {
114119
}
115120
}
116121

122+
private void disableBlueprintDrop() {
123+
if (settings.optBoolean("blueprintPackageNoDrop", true)) {
124+
log.info("Removing blueprint packages from drop lists");
125+
DropTableUtils.removeBlueprintPackages();
126+
}
127+
}
128+
117129
private void hostilityForSpecialItemRaid() {
118130
if (settings.optBoolean("hostilityForSpecialItemRaid", true)) {
119131
log.info("Enabling hostility for special item raid");
@@ -128,6 +140,18 @@ private void militaryRegulations() {
128140
}
129141
}
130142

143+
private void setMaxPermaMods() {
144+
int maxPermaMods = settings.optInt("maxPermaMods", 0);
145+
Misc.MAX_PERMA_MODS = maxPermaMods;
146+
}
147+
148+
private void stingyRecoveries() {
149+
if (settings.optBoolean("stingyRecoveries", true)) {
150+
log.info("Enabling stingy recoveries");
151+
DropTableUtils.makeRecoveryRequireStoryPoint();
152+
}
153+
}
154+
131155
private void showUninstalledDialog() {
132156
CampaignUIAPI campaignUi = Global.getSector().getCampaignUI();
133157
if (campaignUi == null) {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package starpocalypse.droplist;
2+
3+
public interface DropListModifier {
4+
public void modify();
5+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package starpocalypse.droplist;
2+
3+
import java.util.List;
4+
import lombok.RequiredArgsConstructor;
5+
6+
@RequiredArgsConstructor
7+
public class FighterModifier implements DropListModifier {
8+
9+
private final List<String> fighterList;
10+
11+
@Override
12+
public void modify() {}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package starpocalypse.droplist;
2+
3+
import java.util.List;
4+
import lombok.RequiredArgsConstructor;
5+
6+
@RequiredArgsConstructor
7+
public class IndustryModifier implements DropListModifier {
8+
9+
private final List<String> industryList;
10+
11+
@Override
12+
public void modify() {}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package starpocalypse.droplist;
2+
3+
import java.util.List;
4+
import lombok.RequiredArgsConstructor;
5+
6+
@RequiredArgsConstructor
7+
public class ShipModifier implements DropListModifier {
8+
9+
private final List<String> shipList;
10+
11+
@Override
12+
public void modify() {}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package starpocalypse.droplist;
2+
3+
import java.util.List;
4+
import lombok.RequiredArgsConstructor;
5+
6+
@RequiredArgsConstructor
7+
public class WeaponModifier implements DropListModifier {
8+
9+
private final List<String> weaponList;
10+
11+
@Override
12+
public void modify() {}
13+
}

0 commit comments

Comments
 (0)