public static void FoodToStats(SlugcatStats self, int food, bool extraStats) { if (!self.malnourished) { self.throwingSkill = (food > 0) ? 2 : 0; float statBonus = food * ((extraStats) ? 0.08f : 0.04f); const float STAT_BASE = 0.88f; //1f - (extraStats * food_potential) self.runspeedFac = STAT_BASE - 0.05f + statBonus; self.poleClimbSpeedFac = STAT_BASE + statBonus; self.corridorClimbSpeedFac = STAT_BASE + statBonus; self.lungsFac = STAT_BASE + statBonus; self.generalVisibilityBonus = 0f + statBonus / 10; self.loudnessFac = 1.45f - statBonus / 2; self.visualStealthInSneakMode = 0.11f + statBonus / 2; self.bodyWeightFac -= statBonus / 2; } else { self.throwingSkill = 0; self.loudnessFac = 1.4f; self.generalVisibilityBonus = -0.1f; self.visualStealthInSneakMode = 0.3f; } }
public ExposureController(Player player) { this.player = player; this.stats = this.player.slugcatStats; this.cam = this.player.room.game.cameras[0]; if (this.player.playerState.playerNumber == 0) { this.vignette = new Vignette(this); } this.dead = false; Debug.Log("EXPOSURE CONTROLLER - PLAYER " + this.player.playerState.playerNumber); if (Downpour.debug) { Vector2 sSize = this.player.abstractCreature.world.game.cameras[0].sSize; float offset = 80f * this.player.playerState.playerNumber; labelPlayer = new FLabel("font", "Player " + this.player.playerState.playerNumber); labelPlayer.SetPosition(30.01f, sSize.y - (25f + offset)); labelPlayer.color = new Color(0.4f, 0.3f, 0.8f); labelPlayer.alignment = FLabelAlignment.Left; labelPlayer.alpha = 0f; Futile.stage.AddChild(labelPlayer); labelExposure = new FLabel("font", ""); labelExposure.SetPosition(30.01f, sSize.y - (40f + offset)); labelExposure.color = new Color(0.3f, 1f, 1f); labelExposure.alignment = FLabelAlignment.Left; Futile.stage.AddChild(labelExposure); labelAmbient = new FLabel("font", ""); labelAmbient.SetPosition(30.01f, sSize.y - (55f + offset)); labelAmbient.color = new Color(0.3f, 1f, 1f); labelAmbient.alignment = FLabelAlignment.Left; Futile.stage.AddChild(labelAmbient); labelBlizzard = new FLabel("font", ""); labelBlizzard.SetPosition(30.01f, sSize.y - (70f + offset)); labelBlizzard.color = new Color(0.3f, 1f, 1f); labelBlizzard.alignment = FLabelAlignment.Left; Futile.stage.AddChild(labelBlizzard); labelCooldown = new FLabel("font", ""); labelCooldown.SetPosition(30.01f, sSize.y - (85f + offset)); labelCooldown.color = new Color(0.3f, 1f, 1f); labelCooldown.alignment = FLabelAlignment.Left; Futile.stage.AddChild(labelCooldown); } }
public void InitSleepHud(MultiplayerSleepAndDeathScreen sleepAndDeathScreen, Map.MapData mapData, SlugcatStats charStats) { this.AddPart(new FoodMeter(this, charStats.maxFood, charStats.foodToHibernate)); //if (mapData != null) //{ //this.AddPart(new Map(this, mapData)); //} this.foodMeter.pos = new Vector2(sleepAndDeathScreen.FoodMeterXPos((sleepAndDeathScreen.ID != ProcessManager.ProcessID.SleepScreen) ? 1f : 0f), 0f); this.foodMeter.lastPos = this.foodMeter.pos; this.AddPart(new RainMeter(this, this.fContainers[1])); this.rainMeter.pos = new Vector2(this.rainWorld.options.ScreenSize.x - 335f, this.rainWorld.options.ScreenSize.y - 70f); this.rainMeter.lastPos = this.rainMeter.pos; this.rainMeter.fade = 1f; }
//SLUGCAT STATS public static void KarmaToFood(SlugcatStats self, int karma) { self.maxFood = GetFoodFromKarma(karma).x; self.foodToHibernate = GetFoodFromKarma(karma).y; }
public void InitSleepHud(SleepAndDeathScreen sleepAndDeathScreen, Map.MapData mapData, SlugcatStats charStats) { this.AddPart(new FoodMeter(this, charStats.maxFood, charStats.foodToHibernate)); this.foodMeter.pos = new Vector2(sleepAndDeathScreen.FoodMeterXPos((sleepAndDeathScreen.ID != ProcessManager.ProcessID.SleepScreen) ? 1f : 0f), 0f); this.foodMeter.lastPos = this.foodMeter.pos; if (mapData != null) { this.AddPart(new Map(this, mapData)); } int dayType; if ((this.owner as patch_SleepAndDeathScreen).nextcycleLength < 20000) { dayType = 1; } else if ((this.owner as patch_SleepAndDeathScreen).nextcycleLength < 28000) { dayType = 2; } else { dayType = 3; } this.AddPart(new KarmaMeter(this, this.fContainers[1], new IntVector2(dayType, 12), false)); this.karmaMeter.pos = new Vector2(this.rainWorld.options.ScreenSize.x - 280f, this.rainWorld.options.ScreenSize.y - 70f); this.karmaMeter.lastPos = this.karmaMeter.pos; this.karmaMeter.fade = 1f; if ((this.owner as patch_SleepAndDeathScreen).nextcycleLength2 < 20000) { dayType = 1; } else if ((this.owner as patch_SleepAndDeathScreen).nextcycleLength2 < 28000) { dayType = 2; } else { dayType = 3; } this.AddPart(new KarmaMeter(this, this.fContainers[1], new IntVector2(dayType, 12), false)); this.karmaMeter.pos = new Vector2(this.rainWorld.options.ScreenSize.x - 175f, this.rainWorld.options.ScreenSize.y - 70f); this.karmaMeter.lastPos = this.karmaMeter.pos; this.karmaMeter.fade = 1f; if ((this.owner as patch_SleepAndDeathScreen).nextcycleLength3 < 20000) { dayType = 1; } else if ((this.owner as patch_SleepAndDeathScreen).nextcycleLength3 < 28000) { dayType = 2; } else { dayType = 3; } this.AddPart(new KarmaMeter(this, this.fContainers[1], new IntVector2(dayType, 12), false)); this.karmaMeter.pos = new Vector2(this.rainWorld.options.ScreenSize.x - 70f, this.rainWorld.options.ScreenSize.y - 70f); this.karmaMeter.lastPos = this.karmaMeter.pos; this.karmaMeter.fade = 1f; this.AddPart(new RainMeter(this, this.fContainers[1])); this.rainMeter.pos = new Vector2(this.rainWorld.options.ScreenSize.x - 280f, this.rainWorld.options.ScreenSize.y - 70f); this.rainMeter.lastPos = this.rainMeter.pos; this.rainMeter.fade = 1f; this.AddPart(new RainMeter(this, this.fContainers[1])); this.rainMeter.pos = new Vector2(this.rainWorld.options.ScreenSize.x - 175f, this.rainWorld.options.ScreenSize.y - 70f); this.rainMeter.lastPos = this.rainMeter.pos; this.rainMeter.fade = 1f; this.AddPart(new RainMeter(this, this.fContainers[1])); this.rainMeter.pos = new Vector2(this.rainWorld.options.ScreenSize.x - 70f, this.rainWorld.options.ScreenSize.y - 70f); this.rainMeter.lastPos = this.rainMeter.pos; this.rainMeter.fade = 1f; }
public void ctor(Menu.Menu menu, MenuObject owner, int pageIndex, int slugcatNumber) { orig_ctor(menu, owner, pageIndex, slugcatNumber); hud.ClearAllSprites(); hudContainers = new FContainer[2]; for (int i = 0; i < hudContainers.Length; i++) { hudContainers[i] = new FContainer(); Container.AddChild(hudContainers[i]); } hud = new HUD.HUD(hudContainers, menu.manager.rainWorld, this); saveGameData.karma = Custom.IntClamp(saveGameData.karma, 0, saveGameData.karmaCap); saveGameData.food = Custom.IntClamp(saveGameData.food, 0, SlugcatStats.SlugcatFoodMeter(slugcatNumber).y); hud.AddPart(new KarmaMeter(hud, hudContainers[1], new IntVector2(saveGameData.karma, saveGameData.karmaCap), saveGameData.karmaReinforced)); hud.AddPart(new FoodMeter(hud, SlugcatStats.SlugcatFoodMeter(slugcatNumber).x, SlugcatStats.SlugcatFoodMeter(slugcatNumber).y)); string text = String.Empty; if (saveGameData.shelterName != null && saveGameData.shelterName.Length > 2) { string text2 = saveGameData.shelterName.Substring(0, 2); switch (text2) { case "CC": text = "Chimney Canopy"; break; case "DS": text = "Drainage System"; break; case "HI": text = "Industrial Complex"; break; case "GW": text = "Garbage Wastes"; break; case "SI": text = "Sky Islands"; break; case "SU": text = "Outskirts"; break; case "SH": text = "Shaded Citadel"; break; case "IS": text = "Intake System"; break; case "SL": text = "Shoreline"; break; case "LF": text = "Farm Arrays"; break; case "UW": text = "The Exterior"; break; case "SB": text = "Subterranean"; break; case "SS": text = "Five Pebbles"; break; case "LM": text = "Looks To the Moon"; break; case "MW": text = "The Fragmented Exterior"; break; case "FS": text = "Forest Sanctuary"; break; } if (text.Length > 0) { text2 = text; text = string.Concat(new object[] { text2, " - ", menu.Translate("Cycle"), " ", (slugcatNumber != 2) ? saveGameData.cycle : (RedsIllness.RedsCycles(saveGameData.redsExtraCycles) - saveGameData.cycle) }); } } regionLabel = new MenuLabel(menu, this, text, new Vector2(-1000f, imagePos.y - 249f), new Vector2(200f, 30f), true); regionLabel.label.alignment = FLabelAlignment.Center; subObjects.Add(regionLabel); }
private static void InitSleepHudHK(On.HUD.HUD.orig_InitSleepHud orig, HUD.HUD self, SleepAndDeathScreen sleepAndDeathScreen, Map.MapData mapData, SlugcatStats charStats) { if (!(sleepAndDeathScreen is MultiplayerSleepAndDeathScreen)) { Debug.Log("Calling orig ctor Sleeping Screen"); orig(self, sleepAndDeathScreen, mapData, charStats); return; } self.AddPart(new FoodMeter(self, charStats.maxFood, charStats.foodToHibernate)); //if (mapData != null) //{ //this.AddPart(new Map(this, mapData)); //} self.foodMeter.pos = new Vector2(sleepAndDeathScreen.FoodMeterXPos((sleepAndDeathScreen.ID != ProcessManager.ProcessID.SleepScreen) ? 1f : 0f), 0f); self.foodMeter.lastPos = self.foodMeter.pos; RainMeterMultiplayer rainMeter = new RainMeterMultiplayer(self, self.fContainers[1]); rainMeter.pos = new Vector2(self.rainWorld.options.ScreenSize.x - 335f, self.rainWorld.options.ScreenSize.y - 70f); self.AddPart(rainMeter); }
protected override void GetStats(SlugcatStats stats) { stats.throwingSkill = 2; }