Starsector API
Loading...
Searching...
No Matches
SindrianDiktatPunitiveExpedition.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.intel.group;
2
3import com.fs.starfarer.api.Global;
4import com.fs.starfarer.api.campaign.CampaignFleetAPI;
5import com.fs.starfarer.api.impl.campaign.ids.FleetTypes;
6import com.fs.starfarer.api.impl.campaign.ids.MemFlags;
7import com.fs.starfarer.api.impl.campaign.missions.FleetCreatorMission;
8import com.fs.starfarer.api.util.IntervalUtil;
9import com.fs.starfarer.api.util.Misc;
10
11
12
14
15 public static final String SDPE_FLEET = "$SDPE_fleet";
16
17 public static String KEY = "$SDPE_ref";
19 return (SindrianDiktatPunitiveExpedition) Global.getSector().getMemoryWithoutUpdate().get(KEY);
20 }
21
22
23 protected IntervalUtil interval = new IntervalUtil(0.1f, 0.3f);
24
25
26 public SindrianDiktatPunitiveExpedition(GenericRaidParams params) {
27 super(params);
28
29 Global.getSector().getMemoryWithoutUpdate().set(KEY, this);
30 }
31
32 @Override
33 protected void notifyEnding() {
34 super.notifyEnding();
35
36 Global.getSector().getMemoryWithoutUpdate().unset(KEY);
37 }
38
39 @Override
40 protected void notifyEnded() {
41 super.notifyEnded();
42 }
43
44
45 @Override
46 public String getNoun() {
47 return super.getNoun();
48 //return "punitive expedition";
49 }
50
51 @Override
52 public String getForcesNoun() {
53 return super.getForcesNoun();
54 }
55
56
57 @Override
58 public String getBaseName() {
59 return super.getBaseName();
60 //return Misc.ucFirst(getFaction().getPersonNamePrefix()) + " " + "Punitive Expedition";
61 }
62
63
64 @Override
65 protected void preConfigureFleet(int size, FleetCreatorMission m) {
66 m.setFleetTypeMedium(FleetTypes.TASK_FORCE); // default would be "Patrol", don't want that
67 }
68
69 @Override
70 protected void configureFleet(int size, FleetCreatorMission m) {
71 m.triggerSetFleetFlag(SDPE_FLEET);
72 if (size >= 8) {
73 m.triggerSetFleetDoctrineOther(5, 0); // more capitals in large fleets
74 }
75 }
76
77
78 @Override
79 public void abort() {
80 if (!isAborted()) {
81 for (CampaignFleetAPI curr : getFleets()) {
82 curr.getMemoryWithoutUpdate().unset(SDPE_FLEET);
83 }
84 }
85 super.abort();
86 }
87
88
89
90 @Override
91 public void advance(float amount) {
92 super.advance(amount);
93
94 float days = Misc.getDays(amount);
95 interval.advance(days);
96
97 if (interval.intervalElapsed()) {
99 String reason = "SDPunEx";
100 for (CampaignFleetAPI curr : getFleets()) {
101 Misc.setFlagWithReason(curr.getMemoryWithoutUpdate(), MemFlags.MEMORY_KEY_MAKE_HOSTILE,
102 reason, true, 1f);
103 }
104
105 }
106 }
107 }
108
109
110
111}
112
113
114
115
static SectorAPI getSector()
Definition Global.java:59