public AlexBuff(Farmer farmer, NPC npc, CompanionsManager manager) : base(farmer, npc, manager) { buff = new Buff(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 30, "", ""); buff.description = "Alex's fighting spirit seems to awaken yours as well." + Environment.NewLine + "You get +20% attack power and gain 'Warrior Energy' after slaying an enemy."; buffOwnerLastMonstersSlain = buffOwner.stats.MonstersKilled; OnAddAction(); }
public void Dispose() { ModEntry.modHelper.Events.Player.Warped -= Player_Warped; if (currentState != null) { currentState.ExitState(); } currentState = null; owner = null; }
public SamBuff(Farmer farmer, NPC npc, CompanionsManager manager) : base(farmer, npc, manager) { buff = new Buff(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 30, "", ""); buff.description = "Sam likes to live fast (but hopefully he won't die TOO young)." + System.Environment.NewLine + "You gain +2 speed while in his stead."; statBuffs = new Buff[1]; statBuffs[0] = new Buff(0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 30, "", ""); statBuffs[0].description = "+2 Speed" + System.Environment.NewLine + "Source: Sam"; }
public ShaneBuff(Farmer farmer, NPC npc, CompanionsManager manager) : base(farmer, npc, manager) { buff = new Buff(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 30, "", ""); buff.description = "Shane may shun organic ingredients in favor of frozen pizza, but he's still good with chickens." + Environment.NewLine + "You gain +3 farming with Shane."; statBuffs = new Buff[1]; statBuffs[0] = new Buff(3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, "", ""); statBuffs[0].description = "+3 Farming" + Environment.NewLine + "Source: Shane"; }
public PennyBuff(Farmer farmer, NPC npc, CompanionsManager manager) : base(farmer, npc, manager) { buff = new Buff(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 30, "", ""); buff.description = "Penny's a true homesteader, and she's more than willing to help out on the farm!" + Environment.NewLine + "You gain +3 Farming with her at your side."; statBuffs = new Buff[1]; statBuffs[0] = new Buff(3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, "", ""); statBuffs[0].description = "+3 Farming" + Environment.NewLine + "Source: Penny"; }
public void Reset(CompanionsManager manager, string name) { this.manager = manager; this.companion = Game1.getCharacterFromName(name); this.states = new CompanionState[5]; this.states[0] = new ResetState(this); this.states[1] = new UnavailableState(this); this.states[2] = new AvailableState(this); this.currentState = new ResetState(this); script = ModEntry.modHelper.Content.Load <Dictionary <string, string> >("assets/" + name + "Companion.json", ContentSource.ModFolder); availabilityDays = (string[])(typeof(ModConfig).GetField(name).GetValue(ModEntry.config)); }
public HaleyBuff(Farmer farmer, NPC npc, CompanionsManager manager) : base(farmer, npc, manager) { buff = new Buff(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 30, "", ""); buff.description = "When Haley's around, good things just seem to happen more often." + Environment.NewLine + "Your luck is increased +2! She's also an expert at catching fond" + Environment.NewLine + "memories in her lens, increasing your exp gained by 5% (minimum +1)."; statBuffs = new Buff[1]; statBuffs[0] = new Buff(0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 30, "", ""); statBuffs[0].description = "+2 Luck" + Environment.NewLine + "Source: Haley"; Patches.increaseExperience = true; Patches.farmer = buffOwner.Name; }
public AI_StateMachine(CompanionsManager owner) { this.owner = owner; states = new AI_State[2]; states[0] = new AI_StateFollowCharacter(owner.companion, owner.farmer, this); states[1] = new AI_StateAggroEnemy(owner.companion, owner.farmer, this); bools = new Dictionary <string, bool>(); ChangeState(eAI_State.followFarmer); ModEntry.modHelper.Events.Player.Warped += Player_Warped; }
// Use this for initialization void Awake() { instance = this; // store the level buttons in an array double the size of all available levels. // the 2 buttons for one level (landscape and portrait) will be stored at level * 2 and level * 2 + 1 (doesn't matter the order as we shouldn't need it) levelButtons = new LoadLevelButton[(LoadLevelButton.maxLevels + 1) * 2]; //to keep indexing from one to make code more readable positionsLandscape = new Vector3[companionsLandscape.Length]; positionsPortrait = new Vector3[companionsPortrait.Length]; for (int i = 0; i < companionsLandscape.Length; ++i) { positionsLandscape[i] = companionsLandscape[i].transform.localPosition; positionsPortrait[i] = companionsPortrait[i].transform.localPosition; } }
public MaruBuff(Farmer farmer, NPC npc, CompanionsManager manager) : base(farmer, npc, manager) { prosthetics = new Buff[6]; prosthetics[0] = new Buff(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 30, "", ""); prosthetics[0].description = "Hypersonic Locomo-tronic Leg Braces! +1 Speed" + Environment.NewLine + "Source: Maru"; prosthetics[1] = new Buff(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, "", ""); prosthetics[1].description = "SPF 200 Farmer's Tan Skin Shield! +1 Farming" + Environment.NewLine + "Source: Maru"; prosthetics[2] = new Buff(0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, "", ""); prosthetics[2].description = "Tension-Sensing Reflex Enhancer! +1 Fishing" + Environment.NewLine + "Source: Maru"; prosthetics[3] = new Buff(0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, "", ""); prosthetics[3].description = "Black-hole Pickaxe Grippers! +1 Mining" + Environment.NewLine + "Source: Maru"; prosthetics[4] = new Buff(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 30, "", ""); prosthetics[4].description = "Quantum-Computational Reality Modulator? +1 Luck" + Environment.NewLine + "Source: Maru"; prosthetics[5] = new Buff(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 30, "", ""); prosthetics[5].description = "Olfactory-Occipital-Undergrowth Unionizer! +1 Foraging" + Environment.NewLine + "Source: Maru"; currentProstheticIndex = 0; prosthetic = prosthetics[0]; prosthetic.millisecondsDuration = 1200000; otherBuffs = Game1.buffsDisplay.otherBuffs; Game1.buffsDisplay.addOtherBuff(prosthetic); foreach (Buff p in prosthetics) { p.which = -69; } buff = new Buff(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 30, "", ""); buff.description = "Maru's been working on some prosthetics that can enhance various abilities!" + Environment.NewLine + "You gain +1 to any stat. Use the 'G' key to cycle your current prosthetic."; ModEntry.modHelper.Events.Input.ButtonReleased += Input_ButtonReleased; }
public SebastianBuff(Farmer farmer, NPC npc, CompanionsManager manager) : base(farmer, npc, manager) { buff = new Buff(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 30, "", ""); buff.description = "Hmmmm. Something about Sebastian's buff seems familiar..." + Environment.NewLine + "You gain +1 speed, +1 luck, and +10% attack power."; statBuffs = new Buff[2]; statBuffs[0] = new Buff(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "", ""); statBuffs[0].description = "+1 Luck" + Environment.NewLine + "Source: Sebastian"; statBuffs[1] = new Buff(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "", ""); statBuffs[1].description = "+1 Speed" + Environment.NewLine + "Source: Sebastian"; OnAddAction(); }
public HarveyBuff(Farmer farmer, NPC npc, CompanionsManager manager) : base(farmer, npc, manager) { buff = new Buff(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 30, "", ""); buff.description = "Dr. Harvey is the master of both preventative and reactive medicine." + Environment.NewLine + "You gain defense equal to 1.5x your combat level and your health" + Environment.NewLine + "slowly regenerates while below 80%."; int defense = (int)(buffOwner.CombatLevel * 1.5f); statBuffs = new Buff[1]; statBuffs[0] = new Buff(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, defense, 0, 30, "", ""); statBuffs[0].description = "+" + defense + " Defense" + Environment.NewLine + "Source: Harvey"; buffOwnerMaxHealth = buffOwner.maxHealth; healthThreshold = (int)(buffOwnerMaxHealth * 0.8f); }
public EmilyBuff(Farmer farmer, NPC npc, CompanionsManager manager) : base(farmer, npc, manager) { buff = new Buff(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 30, "", ""); buff.description = "Emily and her powerful spirit will aid you while mining." + Environment.NewLine + "She grants you +2 mining, briefly shields you after being damaged," + Environment.NewLine + "and quickly regenerates your health when it's lower than 40%."; statBuffs = new Buff[1]; statBuffs[0] = new Buff(0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, "", ""); statBuffs[0].description = "+2 Mining" + Environment.NewLine + "Source: Emily"; buffOwnerLastFrameHealth = buffOwner.health; buffOwnerMaxHealth = buffOwner.maxHealth; healthThreshold = (int)(buffOwnerMaxHealth * 0.4f); }
public AbigailBuff(Farmer farmer, NPC npc, CompanionsManager manager) : base(farmer, npc, manager) { buff = new Buff(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 30, "", ""); buff.description = "Hanging out with Abigail get's your adventurer's blood pumping!" + Environment.NewLine + "You gain +1 speed, +1 luck, and +10% attack power."; statBuffs = new Buff[2]; statBuffs[0] = new Buff(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "", ""); statBuffs[0].description = "+1 Luck" + Environment.NewLine + "Source: Abigail"; statBuffs[1] = new Buff(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "", ""); statBuffs[1].description = "+1 Speed" + Environment.NewLine + "Source: Abigail"; OnAddAction(); }
public void Dispose() { for (int i = 0; i < states.Length; i++) { states[i]?.ExitState(); } states = null; this.manager = null; this.companion = null; this.currentState = null; this.script.Clear(); this.script = null; this.availabilityDays = null; recruitDialogue = null; actionDialogue = null; locationDialogue = null; automaticDismissDialogue = null; }
public LeahBuff(Farmer farmer, NPC npc, CompanionsManager manager) : base(farmer, npc, manager) { buff = new Buff(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 30, "", ""); buff.description = "Leah always seems to smell like chopped wood and fall mushrooms." + Environment.NewLine + "You gain +2 Foraging while hanging out with her." + Environment.NewLine + "She's also keen to share forage every once in a while!"; statBuffs = new Buff[1]; statBuffs[0] = new Buff(0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 30, "", ""); statBuffs[0].description = "+2 Foraging" + Environment.NewLine + "Source: Leah"; ModEntry.modHelper.Events.GameLoop.TimeChanged += GameLoop_TimeChanged; ModEntry.modHelper.Events.Display.MenuChanged += Display_MenuChanged; r = new Random((int)Game1.uniqueIDForThisGame + (int)Game1.stats.DaysPlayed); combatWithheldDialogue = ((RecruitedState)manager.possibleCompanions["Leah"].currentState).combatWithheldDialogue; foragedObjects = new List <StardewValley.Object>(); }
public ElliottBuff(Farmer farmer, NPC npc, CompanionsManager manager) : base(farmer, npc, manager) { buff = new Buff(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 30, "", ""); buff.description = "Truly a descendant of Thoreau himself, there's nobody quite" + Environment.NewLine + "like Elliott to sit down and fish with next to a tranquil pond." + Environment.NewLine + "You gain +3 to your Fishing skill and Elliott will occasionally" + Environment.NewLine + "share fresh caught fish with you!"; statBuffs = new Buff[1]; statBuffs[0] = new Buff(0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, "", ""); statBuffs[0].description = "+3 Fishing" + Environment.NewLine + "Source: Elliot"; fishCaught = new List <StardewValley.Object>(); ModEntry.modHelper.Events.Display.MenuChanged += Display_MenuChanged; r = new Random((int)Game1.uniqueIDForThisGame + (int)Game1.stats.DaysPlayed); }