001package com.fs.starfarer.api.impl.campaign.skills; 002 003import java.awt.Color; 004 005import com.fs.starfarer.api.Global; 006import com.fs.starfarer.api.characters.CharacterStatsSkillEffect; 007import com.fs.starfarer.api.characters.DescriptionSkillEffect; 008import com.fs.starfarer.api.characters.MutableCharacterStatsAPI; 009import com.fs.starfarer.api.util.Misc; 010 011public class ColonyManagement { 012 013 public static int ADMINS = 1; 014 public static int COLONY_NUM_BONUS = 1; 015// public static int LEVEL_3_BONUS = 1; 016 017 public static class Level0 implements DescriptionSkillEffect { 018 public String getString() { 019 int baseAdmins = (int)Global.getSector().getPlayerStats().getAdminNumber().getBaseValue(); 020 int baseOutposts = (int)Global.getSector().getPlayerStats().getOutpostNumber().getBaseValue(); 021 022 String colonies = "colonies"; 023 String admins = "administrators"; 024 if (baseOutposts == 1) colonies = "colony"; 025 if (baseAdmins == 1) admins = "administrator"; 026 027 return "At a base level, able to manage up to " + 028 baseAdmins + " " + admins + " and to personally govern " + 029 baseOutposts + " " + colonies + ". " + 030 "The maximum number of colonies governed personally can be" + 031 " exceeded at the cost of a stability penalty."; 032// return "At a base level, able to personally govern " + 033// baseOutposts + " " + colonies + ". " + 034// "The maximum number of colonies can be" + 035// " exceeded at the cost of a stability penalty. Colonies governed by administrators " + 036// "do not count against your personal limit."; 037 } 038 public Color[] getHighlightColors() { 039 Color h = Misc.getHighlightColor(); 040 h = Misc.getDarkHighlightColor(); 041 return new Color[] {h, h, h}; 042 } 043 public String[] getHighlights() { 044 String baseAdmins = "" + (int)Global.getSector().getPlayerStats().getAdminNumber().getBaseValue(); 045 String baseOutposts = "" + (int)Global.getSector().getPlayerStats().getOutpostNumber().getBaseValue(); 046 return new String [] {baseAdmins, baseOutposts}; 047 } 048 public Color getTextColor() { 049 return null; 050 } 051 } 052 053 054 public static class Level1 implements CharacterStatsSkillEffect { 055 056 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 057 stats.getOutpostNumber().modifyFlat(id, COLONY_NUM_BONUS); 058 } 059 060 public void unapply(MutableCharacterStatsAPI stats, String id) { 061 stats.getOutpostNumber().unmodify(id); 062 } 063 064 public String getEffectDescription(float level) { 065 return "Able to personally govern " + (int) COLONY_NUM_BONUS + " additional colony"; 066 } 067 068 public String getEffectPerLevelDescription() { 069 return null; 070 } 071 072 public ScopeDescription getScopeDescription() { 073 return ScopeDescription.NONE; 074 } 075 } 076 077 public static class Level2 implements CharacterStatsSkillEffect { 078 079 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 080 stats.getAdminNumber().modifyFlat(id, ADMINS); 081 } 082 083 public void unapply(MutableCharacterStatsAPI stats, String id) { 084 stats.getAdminNumber().unmodify(id); 085 } 086 087 public String getEffectDescription(float level) { 088 return "Able to manage " + (int) ADMINS + " additional administrator"; 089 } 090 091 public String getEffectPerLevelDescription() { 092 return null; 093 } 094 095 public ScopeDescription getScopeDescription() { 096 return ScopeDescription.NONE; 097 } 098 } 099 100 101// public static class Level3A implements CharacterStatsSkillEffect { 102// 103// public void apply(MutableCharacterStatsAPI stats, String id, float level) { 104// stats.getOutpostNumber().modifyFlat(id, LEVEL_3_BONUS); 105// } 106// 107// public void unapply(MutableCharacterStatsAPI stats, String id) { 108// stats.getOutpostNumber().unmodify(id); 109// } 110// 111// public String getEffectDescription(float level) { 112// int max = (int) Global.getSector().getCharacterData().getPerson().getStats().getOutpostNumber().getBaseValue(); 113// max += LEVEL_2_BONUS; 114// max += LEVEL_3_BONUS; 115// 116// return "Able to personally govern up to " + (int) (max) + " colonies"; 117// //return "Able to personally govern up to " + (int) (max) + " outposts"; 118// } 119// 120// public String getEffectPerLevelDescription() { 121// return null; 122// } 123// 124// public ScopeDescription getScopeDescription() { 125// return ScopeDescription.NONE; 126// } 127// } 128}