public override string NormalMessage(Player player, TerraGuardian guardian) { List <string> Mes = new List <string>(); if (player.GetModPlayer <PlayerMod>().TalkedToLeopoldAboutThePigs) { Mes.Add("*I can try changing the forms of the pig emotions between Cloud and Solid, but I will need all emotions to merge them together.*"); Mes.Add("*There is not exactly a penalty for them being in cloud form, but they may not like It.*"); } Mes.Add("*So, this is where the TerraGuardians have been moving to? I can see why.*"); Mes.Add("*How many times I have to say that my tail is not made of cotton! Stop trying to touch it!*"); Mes.Add("*I spend most of my time reading books, so I know of many things.*"); if (!player.Male) { Mes.Add("*Hey! Get your hand off my tail! It's not made of cotton!*"); } if (!NPC.downedBoss3) { Mes.Add("*The dungeon in your world contains a great amount of readable material I could make use of. But the Old Man wont allow me in.*"); } else { Mes.Add("*So much knowledge found inside the dungeon. From dark secrets to sci-fi literature.*"); } if (guardian.FriendshipGrade < 2) { Mes.Add("*Don't call me bunny, I don't know you yet.*"); } if (NpcMod.HasGuardianNPC(GuardianBase.Bree)) { Mes.Add("*What did I had on my mind during the popularity contest, when I agreed with Bree when she was clearly wrong?*"); } if (Main.dayTime) { if (!Main.eclipse) { Mes.Add("*Too bright! I think I stayed inside home for too long.*"); } else { Mes.Add("*Want some popcorn?*"); Mes.Add("*I think I read about them in a book. Had something to do with the creators.*"); } } else { Mes.Add("*What? It was day a while ago!*"); if (Main.bloodMoon) { Mes.Add("*Interesting, so whenever the red moon rises, monsters gets aggressive and smarter? And what is wrong with the female citizens?*"); Mes.Add("*I'm not scared! And no, the screams didn't came from here!*"); } else { Mes.Add("*This seems like a good night for some reading.*"); Mes.Add("*I tried staring at the moon, but then I got bored. I preffer my books.*"); } } if (NPC.TowerActiveNebula || NPC.TowerActiveSolar || NPC.TowerActiveStardust || NPC.TowerActiveVortex) { Mes.Add("*I feel... Like something bad is about to happen...*"); } if (Terraria.GameContent.Events.BirthdayParty.PartyIsUp) { Mes.Add("*This place is being too noisy, I can't concentrate on my books.*"); Mes.Add("*Could you guys PLEASE SHUT UP!! Oh! I didn't see you there. Need something?*"); Mes.Add("*Ugh... The headache comes... Couldn't they party somewhere else?*"); } if (NpcMod.HasGuardianNPC(GuardianBase.Blue)) { Mes.Add("*I keep avoiding crossing [gn:" + Blue + "]'s path, because everytime she sees me, I pass the next 1~2 hours trying to get off her arms.*"); Mes.Add("*What is [gn:" + Blue + "]'s problem? Whenever she sees a bunny she wants to hug it.*"); Mes.Add("*You wont believe me, but [gn:" + Blue + "] has really strong arms. I have to struggle for hours to be free from them.*"); } if (NpcMod.HasGuardianNPC(Zacks)) { Mes.Add("*I try my best to avoid crossing [gn:" + Zacks + "]'s path, for my own safety.*"); Mes.Add("*Creepy! [gn:" + Zacks + "]'s mouth starts salivating when he sees me!*"); if (PlayerMod.PlayerHasGuardianSummoned(player, Brutus)) { Mes.Add("*Would you mind If I borrow [gn:" + Brutus + "] for a while? I'm still not sure If I'm safe with [gn:" + Zacks + "] around.*"); } } if (PlayerMod.PlayerHasGuardianSummoned(player, Blue)) { Mes.Add("*Uh!? No way! Don't hug me again!*"); Mes.Add("*You again?! Keep your arms off me!*"); } if (PlayerMod.PlayerHasGuardianSummoned(player, Zacks)) { Mes.Add("Great, you came, I wanted to talk to you about some reseaAAAAAAAAHHHHH Zombie!! \n....\nUh... Do you have some more leaves..?"); } if (PlayerMod.PlayerHasGuardianSummoned(player, Mabel)) { Mes.Add("*A...Aa.... Uh.... Could... You please... Go away... With.. Her...*"); Mes.Add("*Ah... Uh... I.... Have to... Go... To the toilet... Yes. The Toilet...*"); } else if (NpcMod.HasGuardianNPC(Mabel)) { Mes.Add("*I get reactionless when [gn:" + Mabel + "] is nearby.*"); } if (NpcMod.HasGuardianNPC(Fluffles)) { Mes.Add("*D-d-did y-you l-let a g-g-ghost l-live here? A-are you out of your mind?*"); Mes.Add("*[nickname], one of the things that mostly scares me are ghosts. Why did you let one live here?*"); Mes.Add("*I think [gn:" + Fluffles + "] knows I'm scared of her. She always catches me off guard to spook me out.*"); Mes.Add("*I look distacted? I'm checking out if [gn:" + Fluffles + "] wont surge from somewhere to give me a scare.*"); //Mes.Add("*You need to speak with [gn:" + Fluffles + "]. The other day she made me faint out of a scare, when I woke up she was over me. I've never been so scared in my life!*"); //That would give a bad impression of what happened. } if (NpcMod.HasGuardianNPC(Luna)) { Mes.Add("*Ah... It's good to have [gn:" + Luna + "] around. She causes less influx of questions upon me.*"); } if (!Main.dayTime && !Main.bloodMoon) { Mes.Add("*Looks like I'll have troubles sleeping this night...*"); } if (NpcMod.HasGuardianNPC(Michelle)) { Mes.Add("*I discovered a way of dealing with [gn:" + Michelle + "], I just need to talk about my researches.*"); Mes.Add("*That girl [gn:" + Michelle + "] surelly is curious. I wonder, what's wrong with her?*"); } if (NpcMod.HasGuardianNPC(Malisha)) { Mes.Add("*Of everyone you could have let move into this world, you had to let [gn:" + Malisha + "] live here? She's a menace to us all!*"); Mes.Add("*During my life of mentoring, I never regretted teaching someone, except for [gn:" + Malisha + "]. She's not careless, or cares about the wellbeing of the people she does experiements to.*"); Mes.Add("*Sometimes I think [gn:" + Malisha + "] is trying to eat me. If I suddenly disappear, try looking inside her mouth.*"); Mes.Add("*Huh? Sorry, I'm trying to make my house \"[gn:" + Malisha + "] proof\".*"); Mes.Add("*My greatest misfortunes in life begins when [gn:" + Malisha + "] says that has a new experiement to test.*"); if (NpcMod.HasGuardianNPC(Zacks)) { Mes.Add("*I wouldn't be surprised if what happened to [gn:" + Zacks + "] wasn't [gn:" + Malisha + "]s doing.*"); } } if (NpcMod.HasGuardianNPC(Miguel)) { Mes.Add("*No no no! As I said to [gn:" + Miguel + "], I'd rather do anything else than boring exercises. And tell him to stop sending people to persuade me.*"); } if (NpcMod.HasGuardianNPC(Green)) { Mes.Add("*I had to help [gn:" + Green + "] by borrowing some terrarian anathomy books to him.*"); } if (NpcMod.HasGuardianNPC(Cille)) { Mes.Add("*[gn:" + Cille + "] seems to avoid contact with anyone. I wonder, why?*"); Mes.Add("*I think I saw [gn:" + Cille + "] around my house during a New Moon Night. Well, at least I think It was [gn:" + Cille + "], since I only saw a shadow like her.*"); } if (guardian.IsUsingToilet) { Mes.Add("*What's with you Terrarians? Don't you know that this is a moment of privacy?*"); if (!player.Male) { Mes.Add("*No! Don't try touching my tail now!*"); } Mes.Add("*You're interrupting my reflection moment! Go away!*"); } if (guardian.IsPlayerRoomMate(player)) { Mes.Add("*Yes, I don't mind sharing my room with you, just place your bed somewhere.*"); Mes.Add("*I hope you don't snore at night, because I need sleep to process my researches.*"); Mes.Add("*You're not planning on throwing parties every night, I've had enough of those during the Magic University.*"); } if (NpcMod.IsGuardianPlayerRoomMate(player, Malisha)) { Mes.Add("*You must either be courageous, or very stupid, for sharing your room with [gn:" + Malisha + "]. Who knows what she does to you while you sleep?*"); Mes.Add("*Stop sharing room with [gn:" + Malisha + "], you may wake up tied in a bed while she does wacky experiements on you.*"); } if (guardian.KnockedOut) { Mes.Clear(); Mes.Add("(" + guardian.Name + " looks at you, wanting you to heal his wounds)"); Mes.Add("(He seems to be under heavy pain.)"); Mes.Add("(He's unnable to speak with you because of how much pain he's having.)"); } else if (guardian.IsSleeping) { Mes.Clear(); Mes.Add("(He's theorizing to himself, while sleeping.)"); Mes.Add("(Is he saying elements of the periodic table?)"); if (NpcMod.HasGuardianNPC(Malisha)) { Mes.Add("*No! Go away! Don't come closer! No! NOOOOOOOOOO!!!! (I think [gn:" + Malisha + "] appeared on his dream)*"); Mes.Add("*Wait! What is in that flask! No! I wont drink it! NO! NOOOO!! (I think [gn:" + Malisha + "] appeared on his dream)*"); } } if (FlufflesBase.IsHauntedByFluffles(player) && Main.rand.NextDouble() < 0.75) { Mes.Clear(); Mes.Add("*Yaaaaaaaaaaaah- Oh no, now I gotta wipe myself.*"); } return(Mes[Main.rand.Next(Mes.Count)]); }
public static void ApplyAccessoryEffect(TerraGuardian guardian, Item i) { if (i.type == 0) { return; } switch (i.type) { case ItemID.BandofStarpower: guardian.MMP += 20; break; case ItemID.ManaRegenerationBand: guardian.MMP += 20; guardian.ManaRegenBonus += 25; guardian.AddFlag(GuardianFlags.ManaRegenDelayReduction); break; case ItemID.MagicCuffs: guardian.MMP += 20; guardian.ManaRegenBonus += 25; guardian.AddFlag(GuardianFlags.MagicCuffs); guardian.AddFlag(GuardianFlags.ManaRegenDelayReduction); break; case ItemID.CelestialMagnet: guardian.AddFlag(GuardianFlags.StarMagnet); break; case ItemID.CelestialCuffs: guardian.MMP += 20; guardian.ManaRegenBonus += 25; guardian.AddFlag(GuardianFlags.MagicCuffs); guardian.AddFlag(GuardianFlags.ManaRegenDelayReduction); guardian.AddFlag(GuardianFlags.StarMagnet); break; case ItemID.CelestialEmblem: guardian.AddFlag(GuardianFlags.StarMagnet); guardian.MagicDamageMultiplier += 0.15f; break; case ItemID.NaturesGift: guardian.ManaCostMult -= 0.06f; break; case ItemID.ManaFlower: guardian.ManaCostMult -= 0.08f; guardian.AddFlag(GuardianFlags.AutoManaPotion); break; case ItemID.Aglet: guardian.MoveSpeed += 0.05f; break; case ItemID.ShinyRedBalloon: case ItemID.BalloonPufferfish: guardian.AddFlag(GuardianFlags.JumpHeightBoost); break; case ItemID.FartinaJar: guardian.AddFlag(GuardianFlags.ExtraJumpFart); break; case ItemID.CloudinaBottle: guardian.AddFlag(GuardianFlags.ExtraJumpCloud); break; case ItemID.BlizzardinaBottle: guardian.AddFlag(GuardianFlags.ExtraJumpBlizzard); break; case ItemID.TsunamiInABottle: guardian.AddFlag(GuardianFlags.ExtraJumpWater); break; case ItemID.SandstorminaBottle: guardian.AddFlag(GuardianFlags.ExtraJumpSand); break; case ItemID.CloudinaBalloon: guardian.AddFlag(GuardianFlags.ExtraJumpCloud); guardian.AddFlag(GuardianFlags.JumpHeightBoost); break; case ItemID.BlizzardinaBalloon: guardian.AddFlag(GuardianFlags.ExtraJumpBlizzard); guardian.AddFlag(GuardianFlags.JumpHeightBoost); break; case ItemID.SandstorminaBalloon: guardian.AddFlag(GuardianFlags.ExtraJumpSand); guardian.AddFlag(GuardianFlags.JumpHeightBoost); break; case ItemID.SharkronBalloon: guardian.AddFlag(GuardianFlags.ExtraJumpCloud); guardian.AddFlag(GuardianFlags.ExtraJumpWater); guardian.AddFlag(GuardianFlags.JumpHeightBoost); break; case ItemID.BalloonHorseshoeSharkron: guardian.AddFlag(GuardianFlags.ExtraJumpCloud); guardian.AddFlag(GuardianFlags.ExtraJumpWater); guardian.AddFlag(GuardianFlags.JumpHeightBoost); guardian.AddFlag(GuardianFlags.FallDamageImmunity); break; case ItemID.BundleofBalloons: guardian.AddFlag(GuardianFlags.ExtraJumpCloud); guardian.AddFlag(GuardianFlags.ExtraJumpBlizzard); guardian.AddFlag(GuardianFlags.ExtraJumpSand); guardian.AddFlag(GuardianFlags.JumpHeightBoost); break; case ItemID.LuckyHorseshoe: guardian.AddFlag(GuardianFlags.FallDamageImmunity); break; case ItemID.AnkletoftheWind: guardian.MoveSpeed += 0.1f; break; case ItemID.HermesBoots: case ItemID.FlurryBoots: case ItemID.SailfishBoots: guardian.DashSpeed = guardian.Base.MaxSpeed * 2; break; case ItemID.SpectreBoots: guardian.DashSpeed = guardian.Base.MaxSpeed * 2; guardian.RocketType = 2; break; case ItemID.RocketBoots: guardian.RocketType = 1; break; case ItemID.LightningBoots: guardian.DashSpeed = guardian.Base.MaxSpeed * 2.25f; guardian.RocketType = 2; guardian.MoveSpeed += 0.08f; break; case ItemID.FrostsparkBoots: guardian.DashSpeed = guardian.Base.MaxSpeed * 2.25f; guardian.RocketType = 3; guardian.MoveSpeed += 0.08f; guardian.AddFlag(GuardianFlags.IceSkating); break; case ItemID.IceSkates: guardian.AddFlag(GuardianFlags.IceSkating); break; case ItemID.BlueHorseshoeBalloon: guardian.AddFlag(GuardianFlags.ExtraJumpCloud); guardian.AddFlag(GuardianFlags.JumpHeightBoost); guardian.AddFlag(GuardianFlags.FallDamageImmunity); break; case ItemID.WhiteHorseshoeBalloon: guardian.AddFlag(GuardianFlags.ExtraJumpBlizzard); guardian.AddFlag(GuardianFlags.JumpHeightBoost); guardian.AddFlag(GuardianFlags.FallDamageImmunity); break; case ItemID.YellowHorseshoeBalloon: guardian.AddFlag(GuardianFlags.ExtraJumpSand); guardian.AddFlag(GuardianFlags.JumpHeightBoost); guardian.AddFlag(GuardianFlags.FallDamageImmunity); break; case ItemID.BalloonHorseshoeFart: guardian.AddFlag(GuardianFlags.ExtraJumpFart); guardian.AddFlag(GuardianFlags.JumpHeightBoost); guardian.AddFlag(GuardianFlags.FallDamageImmunity); break; case ItemID.BalloonHorseshoeHoney: guardian.AddFlag(GuardianFlags.BeeCounter); guardian.AddFlag(GuardianFlags.JumpHeightBoost); guardian.AddFlag(GuardianFlags.FallDamageImmunity); break; case ItemID.ObsidianHorseshoe: guardian.AddFlag(GuardianFlags.FallDamageImmunity); guardian.AddFlag(GuardianFlags.FireblocksImmunity); break; case ItemID.HoneyComb: guardian.AddFlag(GuardianFlags.BeeCounter); break; case ItemID.HoneyBalloon: guardian.AddFlag(GuardianFlags.BeeCounter); guardian.AddFlag(GuardianFlags.JumpHeightBoost); break; case ItemID.Flipper: guardian.AddFlag(GuardianFlags.SwimmingAbility); break; case ItemID.DivingGear: guardian.AddFlag(GuardianFlags.ExtendedBreath); guardian.AddFlag(GuardianFlags.SwimmingAbility); break; case ItemID.JellyfishNecklace: guardian.AddFlag(GuardianFlags.UnderwaterJellyfishGlow); break; case ItemID.JellyfishDivingGear: guardian.AddFlag(GuardianFlags.ExtendedBreath); guardian.AddFlag(GuardianFlags.SwimmingAbility); guardian.AddFlag(GuardianFlags.UnderwaterJellyfishGlow); break; case ItemID.ArcticDivingGear: guardian.AddFlag(GuardianFlags.ExtendedBreath); guardian.AddFlag(GuardianFlags.SwimmingAbility); guardian.AddFlag(GuardianFlags.UnderwaterJellyfishGlow); guardian.AddFlag(GuardianFlags.IceSkating); break; case ItemID.ClimbingClaws: guardian.AddFlag(GuardianFlags.ClimbingClaws); break; case ItemID.ShoeSpikes: guardian.AddFlag(GuardianFlags.ClimbingPaws); break; case ItemID.TigerClimbingGear: guardian.AddFlag(GuardianFlags.ClimbingClaws); guardian.AddFlag(GuardianFlags.ClimbingPaws); break; case ItemID.MasterNinjaGear: guardian.AddFlag(GuardianFlags.ClimbingClaws); guardian.AddFlag(GuardianFlags.ClimbingPaws); guardian.AddFlag(GuardianFlags.Dash); guardian.DodgeRate += 10; break; case ItemID.Tabi: guardian.AddFlag(GuardianFlags.Dash); break; case ItemID.BlackBelt: guardian.DodgeRate += 10; break; case ItemID.FrogLeg: guardian.AddFlag(GuardianFlags.AllowHopping); guardian.JumpSpeed += 2.4f; guardian.FallHeightTolerance += 15; break; case ItemID.LavaCharm: guardian.AddFlag(GuardianFlags.LavaTolerance); break; case ItemID.WaterWalkingBoots: guardian.AddFlag(GuardianFlags.WaterWalking); break; case ItemID.ObsidianWaterWalkingBoots: guardian.AddFlag(GuardianFlags.WaterWalking); guardian.AddFlag(GuardianFlags.FireblocksImmunity); break; case ItemID.LavaWaders: guardian.AddFlag(GuardianFlags.LavaTolerance); guardian.AddFlag(GuardianFlags.WaterWalking); guardian.AddFlag(GuardianFlags.FireblocksImmunity); break; case ItemID.CobaltShield: guardian.AddFlag(GuardianFlags.KnockbackImmunity); break; case ItemID.ObsidianShield: guardian.AddFlag(GuardianFlags.KnockbackImmunity); guardian.AddFlag(GuardianFlags.FireblocksImmunity); break; case ItemID.AnkhShield: guardian.AddFlag(GuardianFlags.KnockbackImmunity); guardian.AddFlag(GuardianFlags.FireblocksImmunity); guardian.AddBuffImmunity(BuffID.Bleeding); guardian.AddBuffImmunity(BuffID.BrokenArmor); guardian.AddBuffImmunity(BuffID.Confused); guardian.AddBuffImmunity(BuffID.Cursed); guardian.AddBuffImmunity(BuffID.Darkness); guardian.AddBuffImmunity(BuffID.Poisoned); guardian.AddBuffImmunity(BuffID.Silenced); guardian.AddBuffImmunity(BuffID.Slow); guardian.AddBuffImmunity(BuffID.Weak); guardian.AddBuffImmunity(BuffID.Burning); break; case ItemID.StarCloak: guardian.AddFlag(GuardianFlags.StarCounter); break; case ItemID.CrossNecklace: guardian.AddFlag(GuardianFlags.ImprovedImmuneTime); break; case ItemID.StarVeil: guardian.AddFlag(GuardianFlags.ImprovedImmuneTime); guardian.AddFlag(GuardianFlags.StarCounter); break; case ItemID.BeeCloak: guardian.AddFlag(GuardianFlags.StarCounter); guardian.AddFlag(GuardianFlags.BeeCounter); break; case ItemID.AvengerEmblem: guardian.MeleeDamageMultiplier += 0.12f; guardian.RangedDamageMultiplier += 0.12f; guardian.MagicDamageMultiplier += 0.12f; guardian.SummonDamageMultiplier += 0.12f; break; case ItemID.WarriorEmblem: guardian.MeleeDamageMultiplier += 0.15f; break; case ItemID.RangerEmblem: guardian.RangedDamageMultiplier += 0.15f; break; case ItemID.SorcererEmblem: guardian.MagicDamageMultiplier += 0.15f; break; case ItemID.SummonerEmblem: guardian.SummonDamageMultiplier += 0.15f; break; case ItemID.MoonCharm: guardian.AddFlag(GuardianFlags.WerewolfAcc); break; case ItemID.FlowerBoots: guardian.AddFlag(GuardianFlags.FlowerBoots); break; case ItemID.NeptunesShell: guardian.AddFlag(GuardianFlags.MerfolkAcc); break; case ItemID.MoonShell: guardian.AddFlag(GuardianFlags.WerewolfAcc); guardian.AddFlag(GuardianFlags.MerfolkAcc); break; case ItemID.SunStone: guardian.AddFlag(GuardianFlags.SunBuff); break; case ItemID.MoonStone: guardian.AddFlag(GuardianFlags.MoonBuff); break; case ItemID.CelestialStone: guardian.AddFlag(GuardianFlags.SunBuff); guardian.AddFlag(GuardianFlags.MoonBuff); break; case ItemID.CelestialShell: guardian.AddFlag(GuardianFlags.SunBuff); guardian.AddFlag(GuardianFlags.MoonBuff); guardian.AddFlag(GuardianFlags.WerewolfAcc); guardian.AddFlag(GuardianFlags.MerfolkAcc); break; case ItemID.RifleScope: guardian.AddFlag(GuardianFlags.Scope); break; case ItemID.SniperScope: guardian.AddFlag(GuardianFlags.Scope); guardian.RangedDamageMultiplier += 0.1f; guardian.RangedCriticalRate += 10; break; case ItemID.DestroyerEmblem: guardian.MeleeDamageMultiplier += 0.1f; guardian.RangedDamageMultiplier += 0.1f; guardian.MagicDamageMultiplier += 0.1f; guardian.SummonDamageMultiplier += 0.1f; guardian.MeleeCriticalRate += 8; guardian.RangedCriticalRate += 8; guardian.MagicCriticalRate += 8; break; case ItemID.FeralClaws: guardian.MeleeSpeed += 0.12f; break; case ItemID.ObsidianRose: guardian.AddFlag(GuardianFlags.LavaDamageReduction); break; case ItemID.MagicQuiver: guardian.RangedDamageMultiplier += 0.1f; guardian.AddFlag(GuardianFlags.ArrowBuff); break; case ItemID.MagmaStone: guardian.AddFlag(GuardianFlags.MagmaStone); break; case ItemID.FireGauntlet: guardian.MeleeDamageMultiplier += 0.1f; guardian.MeleeKnockback += 0.8f; guardian.MeleeSpeed += 0.1f; guardian.AddFlag(GuardianFlags.MagmaStone); break; case ItemID.MechanicalGlove: guardian.MeleeDamageMultiplier += 0.12f; guardian.MeleeKnockback += 0.7f; guardian.MeleeSpeed += 0.12f; break; case ItemID.PowerGlove: guardian.MeleeKnockback += 0.7f; guardian.MeleeSpeed += 0.12f; break; case ItemID.TitanGlove: guardian.MeleeKnockback += 0.7f; break; case ItemID.FleshKnuckles: guardian.AddFlag(GuardianFlags.Tanking); //guardian.Defense += 7; break; case ItemID.FrozenTurtleShell: guardian.AddFlag(GuardianFlags.FrozenTurtleShell); break; case ItemID.PaladinsShield: //guardian.Defense += 6; guardian.CoverRate += 25; guardian.AddFlag(GuardianFlags.KnockbackImmunity); break; case ItemID.PutridScent: guardian.MeleeDamageMultiplier += 0.05f; guardian.RangedDamageMultiplier += 0.05f; guardian.MagicDamageMultiplier += 0.05f; guardian.SummonDamageMultiplier += 0.05f; guardian.MeleeCriticalRate += 5; guardian.RangedCriticalRate += 5; guardian.MagicCriticalRate += 5; break; case ItemID.SharkToothNecklace: guardian.MeleeDamageMultiplier += 0.05f; guardian.RangedDamageMultiplier += 0.05f; guardian.MagicDamageMultiplier += 0.05f; guardian.SummonDamageMultiplier += 0.05f; break; case ItemID.HerculesBeetle: guardian.SummonDamageMultiplier += 0.15f; break; case ItemID.NecromanticScroll: guardian.SummonDamageMultiplier += 0.10f; guardian.MaxMinions++; break; case ItemID.PapyrusScarab: guardian.SummonDamageMultiplier += 0.25f; guardian.MaxMinions++; break; case ItemID.PygmyNecklace: guardian.MaxMinions++; break; case ItemID.PhilosophersStone: guardian.AddFlag(GuardianFlags.ReduceHealingPotionCooldown); break; case ItemID.BandofRegeneration: guardian.AddFlag(GuardianFlags.ImprovedHealthRegeneration); break; case ItemID.CharmofMyths: guardian.AddFlag(GuardianFlags.ReduceHealingPotionCooldown); guardian.AddFlag(GuardianFlags.ImprovedImmuneTime); guardian.AddFlag(GuardianFlags.ImprovedHealthRegeneration); //Health regen bonus break; case ItemID.WormScarf: guardian.DefenseRate += 17; break; case ItemID.HiveBackpack: guardian.AddFlag(GuardianFlags.BeeBuff); break; case ItemID.PanicNecklace: guardian.AddFlag(GuardianFlags.PanicNecklace); break; case ItemID.SweetheartNecklace: guardian.AddFlag(GuardianFlags.PanicNecklace); guardian.AddFlag(GuardianFlags.BeeCounter); break; case ItemID.AdhesiveBandage: guardian.AddBuffImmunity(BuffID.Bleeding); break; case ItemID.AnkhCharm: guardian.AddBuffImmunity(BuffID.Bleeding); guardian.AddBuffImmunity(BuffID.BrokenArmor); guardian.AddBuffImmunity(BuffID.Confused); guardian.AddBuffImmunity(BuffID.Cursed); guardian.AddBuffImmunity(BuffID.Darkness); guardian.AddBuffImmunity(BuffID.Poisoned); guardian.AddBuffImmunity(BuffID.Silenced); guardian.AddBuffImmunity(BuffID.Slow); guardian.AddBuffImmunity(BuffID.Weak); break; case ItemID.ArmorPolish: guardian.AddBuffImmunity(BuffID.BrokenArmor); break; case ItemID.Vitamins: guardian.AddBuffImmunity(BuffID.Weak); break; case ItemID.ArmorBracing: guardian.AddBuffImmunity(BuffID.Weak); guardian.AddBuffImmunity(BuffID.BrokenArmor); break; case ItemID.Bezoar: guardian.AddBuffImmunity(BuffID.Poisoned); break; case ItemID.MedicatedBandage: guardian.AddBuffImmunity(BuffID.Bleeding); guardian.AddBuffImmunity(BuffID.Poisoned); break; case ItemID.Blindfold: guardian.AddBuffImmunity(BuffID.Darkness); break; case ItemID.CountercurseMantra: guardian.AddBuffImmunity(BuffID.Silenced); guardian.AddBuffImmunity(BuffID.Cursed); break; case ItemID.Megaphone: guardian.AddBuffImmunity(BuffID.Silenced); break; case ItemID.Nazar: guardian.AddBuffImmunity(BuffID.Cursed); break; case ItemID.FastClock: guardian.AddBuffImmunity(BuffID.Slow); break; case ItemID.TrifoldMap: guardian.AddBuffImmunity(BuffID.Confused); break; case ItemID.ThePlan: guardian.AddBuffImmunity(BuffID.Slow); guardian.AddBuffImmunity(BuffID.Confused); break; case ItemID.HandWarmer: guardian.AddBuffImmunity(BuffID.Chilled); guardian.AddBuffImmunity(BuffID.Frozen); break; //Wings case 492: case 493: case 2494: guardian.WingMaxFlightTime = 100; break; case 748: guardian.WingMaxFlightTime = 115; break; case 749: case 761: case 1515: guardian.WingMaxFlightTime = 130; break; case 785: case 786: case 1165: guardian.WingMaxFlightTime = 140; break; case 665: case 1583: case 1584: case 1585: case 1586: case 3228: case 3580: case 3582: case 3588: case 3592: case 3883: guardian.WingMaxFlightTime = 150; break; case 821: case 822: case 823: case 1162: case 2280: case 2770: case 3469: case 3470: guardian.WingMaxFlightTime = 160; break; case 1866: case 1871: guardian.WingMaxFlightTime = 170; break; case 2609: guardian.WingMaxFlightTime = 180; //Ignore water effect? break; case 948: case 1797: case 1830: case 3468: case 3471: guardian.WingMaxFlightTime = 180; break; } }
public override void Update(TerraGuardian guardian) { guardian.MHP = (int)(guardian.MHP * 0.95f); guardian.Defense -= 5; }
public override string HasRequestMessage(Player player, TerraGuardian guardian) { return("(She's staring at you, attentiously. She seems to be wanting... [objective]..?)"); }
public override string GreetMessage(Player player, TerraGuardian guardian) { return("(As she fixes her eyes at you, she approaches and snifs you. After doing so, she started to wag her tail and bark.)"); }
public override bool GuardianCanUseItem(TerraGuardian guardian) { return(true); }
public static void CilleSpawningScripts() { const byte CheckDelayTime = 150; const int CilleID = GuardianBase.Cille; CilleSpawnCheckDelay++; if (CilleSpawnCheckDelay < CheckDelayTime) { return; } CilleSpawnCheckDelay -= CheckDelayTime; if (Main.rand.Next(7) > 0) { return; } if (!NpcMod.HasMetGuardian(CilleID) || NPC.AnyNPCs(ModContent.NPCType <Npcs.CilleNPC>())) { return; } if (NpcMod.HasGuardianNPC(CilleID)) { TerraGuardian tg = NpcMod.GetGuardianNPCCharacter(CilleID); if (tg.FriendshipLevel >= tg.Base.MoveInLevel) { return; } for (int i = 0; i < 255; i++) { if (Main.player[i].active && Math.Abs(tg.Position.X - Main.player[i].Center.X) < 2000 && Math.Abs(tg.Position.Y - Main.player[i].Center.Y) < 1600) { return; } } } if (CilleShelterX == -1 && CilleShelterY == -1) { int Left = (int)(Main.leftWorld * (1f / 16) + 130), Right = (int)(Main.rightWorld * (1f / 16) - 130); int Top = (int)(Main.worldSurface * 0.35f), Bottom = (int)(Main.worldSurface); int PositionX = Main.rand.Next(Left, Right), PositionY = Main.rand.Next(Top, Bottom); Tile tile = Framing.GetTileSafely(PositionX, PositionY); if (tile == null || (tile.active() && Main.tileSolid[tile.type]) || tile.wall > 0) { return; } { byte Counter = 0; while (!tile.active() || !Main.tileSolid[tile.type]) { PositionY++; tile = Framing.GetTileSafely(PositionX, PositionY); if (Counter++ >= 250) { return; } } } tile = Framing.GetTileSafely(PositionX, PositionY); switch (tile.type) { case Terraria.ID.TileID.CorruptGrass: case Terraria.ID.TileID.Ebonstone: case Terraria.ID.TileID.Ebonsand: case Terraria.ID.TileID.FleshGrass: case Terraria.ID.TileID.Crimtane: case Terraria.ID.TileID.Crimsand: case Terraria.ID.TileID.LeafBlock: case Terraria.ID.TileID.LivingWood: case Terraria.ID.TileID.BlueDungeonBrick: case Terraria.ID.TileID.GreenDungeonBrick: case Terraria.ID.TileID.PinkDungeonBrick: return; } PositionY--; tile = Framing.GetTileSafely(PositionX, PositionY); if (tile.wall > 0) { return; } for (int i = 0; i < 255; i++) { if (Main.player[i].active) { if (Math.Abs(Main.player[i].Center.X - PositionX * 16) < 1000 && Math.Abs(Main.player[i].Center.Y - PositionY * 16) < 1000) { return; } } if (i < 200 && Main.npc[i].active) { if (Math.Abs(Main.npc[i].Center.X - PositionX * 16) < 1000 && Math.Abs(Main.npc[i].Center.Y - PositionY * 16) < 800) { return; } } } int HouseBottom; if (!TryPlacingCilleHouse(PositionX, PositionY, out HouseBottom)) { return; } CilleShelterX = PositionX; CilleShelterY = HouseBottom; /*if (!NpcMod.HasGuardianNPC(CilleID)) * { * NpcMod.SpawnGuardianNPC(PositionX * 16, PositionY * 16, CilleID); * } * else * { * TerraGuardian Cille = NpcMod.GetGuardianNPCCharacter(CilleID); * Cille.Position.X = PositionX * 16; * Cille.Position.Y = PositionY * 16; * Cille.SetFallStart(); * }*/ WorldMod.TrySpawningOrMovingGuardianNPC(CilleID, "", CilleShelterX, CilleShelterY, true, true); } else { if (!NpcMod.HasGuardianNPC(CilleID)) { if (!WorldMod.CanGuardianNPCSpawnInTheWorld(CilleID)) { if (Main.dayTime && Main.moonPhase != 4) { List <WorldMod.GuardianTownNpcState> TownNpcsAtThisHouse = WorldMod.GetGuardianLivingHere(CilleShelterX, CilleShelterY); foreach (WorldMod.GuardianTownNpcState tg in TownNpcsAtThisHouse) { if (!tg.CharID.IsSameID(CilleID)) { tg.Homeless = true; tg.HomeX = tg.HomeY = -1; } } if (WorldMod.TrySpawningOrMovingGuardianNPC(CilleID, "", CilleShelterX, CilleShelterY, true, true)) { //NpcMod.SpawnGuardianNPC(CilleShelterX * 16, CilleShelterY * 16, CilleID); } else { CilleShelterX = CilleShelterY = -1; } } } } else { /*if (!Main.dayTime && !WorldMod.CanGuardianNPCSpawnInTheWorld(CilleID)) * { * WorldMod.GuardianTownNpcState townnpc = CilleGuardian.GetTownNpcInfo; * if (townnpc != null) * { * townnpc.Homeless = true; * } * }*/ } } }
public override string CompanionRecruitedMessage(TerraGuardian WhoReacts, GuardianData WhoJoined, out float Weight) { Weight = 1f; return("Hi, I'm [name], what is your name?"); }
public override string NormalMessage(Terraria.Player player, TerraGuardian guardian) { List <string> Mes = new List <string>(); if (Main.bloodMoon) { Mes.Add("What now?!"); Mes.Add("Don't you have anything else to do?"); Mes.Add("What's with that look? Are you indirectly calling me ugly?!"); } else { bool HasTerraGuardians = NpcMod.GetTerraGuardianNPCCount() > 0; Mes.Add("Oh, checking out? I'm fine, thanks for caring."); if (HasTerraGuardians) { Mes.Add("This place is like a dream came true!"); Mes.Add("I can't stop petting those TerraGuardians, they are soooooooooo cute!!"); Mes.Add("How are we able to understand what the TerraGuardians says? It's like as If what they say comes from inside my mind."); } if (Main.dayTime) { if (Main.eclipse) { Mes.Add("What are those things?! They aren't cute at all! Maybe Mothron but... Everything else..."); } else { Mes.Add("(As soon as she started singing, several animals started to gather around her.)"); } } else { Mes.Add("I surelly would like to get a nap, and enjoy this night."); if (HasTerraGuardians) { Mes.Add("I wonder if any TerraGuardian would let me accompany them during the night."); } Mes.Add("Yawn~ I'm surelly getting sleepy."); } if (Main.raining) { Mes.Add("Eww... Rain... I hope I don't catch flu."); Mes.Add("The weather seems ugly outside."); } if (NPC.AnyNPCs(Terraria.ID.NPCID.Stylist)) { Mes.Add("What is wrong with my look? [nn:" + Terraria.ID.NPCID.Stylist + "] keeps making fun of my look."); } if (NPC.AnyNPCs(Terraria.ID.NPCID.Merchant)) { Mes.Add("It's absurd that [nn:" + Terraria.ID.NPCID.Merchant + "] doesn't have any Orange or Yellow Potions for sale. Don't he knows that they heal more?"); } if (NPC.AnyNPCs(Terraria.ID.NPCID.Mechanic)) { Mes.Add("I was kicked out of [nn:" + Terraria.ID.NPCID.Mechanic + "]'s room... She didn't liked when I turned off the light switches after she turned them on..."); } if (NpcMod.HasGuardianNPC(GuardianBase.Rococo)) { Mes.Add("I like [gn:" + GuardianBase.Rococo + "] because he's so easy to be friend of. Soon We'll be BFF."); Mes.Add("[gn:" + GuardianBase.Rococo + "] took me outside someday to watch a meteor shower, in the top of a mountain. It was so beatiful..."); } if (NpcMod.HasGuardianNPC(GuardianBase.Blue)) { Mes.Add("I like touching [gn:" + GuardianBase.Blue + "]'s hair, but she seems to not like it when I do that."); Mes.Add("Say, do you think I'll find someone for me? Like [gn:" + GuardianBase.Blue + "] found."); } if (NpcMod.HasGuardianNPC(GuardianBase.Sardine)) { Mes.Add("[gn:" + GuardianBase.Sardine + "] has so many interesting adventure stories, I wonder if someday I'll have many stories to tell, too."); } if (NpcMod.HasGuardianNPC(GuardianBase.Alex)) { Mes.Add("I keep giving treats to [gn:" + GuardianBase.Alex + "]. He deserves, he's a really good boy, beside one time he stuck my head in the sand when he jumped on me. I think I still have sand in my nose."); } if (NpcMod.HasGuardianNPC(GuardianBase.Zacks)) { Mes.Add("[gn:" + GuardianBase.Zacks + "] is so creepy! He's a cute wolf, but creepy."); Mes.Add("I think that [gn:" + GuardianBase.Zacks + "] is actually a good person, but I keep fearing him because he's a Zombie."); Mes.Add("Wasn't zombies supposed to burn during the day? [gn:" + GuardianBase.Zacks + "] seems fine while walking around during the day. At least I saw them burning in another univese."); } if (NpcMod.HasGuardianNPC(GuardianBase.Brutus)) { Mes.Add("I broke [gn:" + GuardianBase.Brutus + "]'s seriousness easily by petting his head. He started to purr afterwards, too."); Mes.Add("[gn:" + GuardianBase.Brutus + "]'s stories about the Ether Realm are amazing! I want to meet that place someday."); } if (NpcMod.HasGuardianNPC(GuardianBase.Bree)) { Mes.Add("I have a new goal, become BFF of [gn:" + GuardianBase.Bree + "]. Wait, why that face?"); } if (NpcMod.HasGuardianNPC(GuardianBase.Mabel)) { Mes.Add("Why the male people of your town keeps drooling at [gn:" + GuardianBase.Mabel + "]?"); Mes.Add("Miss North Pole contest? Maybe [gn:" + GuardianBase.Mabel + "] could help me get in It too? It sounds fun!"); } if (NpcMod.HasGuardianNPC(GuardianBase.Domino)) { Mes.Add("Whenever I try petting [gn:" + GuardianBase.Domino + "], he tries to bite my hand."); Mes.Add("Why is [gn:" + GuardianBase.Domino + "] so difficult to deal with?"); } if (NpcMod.HasGuardianNPC(GuardianBase.Leopold)) { Mes.Add("What a cute bunny [gn:" + GuardianBase.Leopold + "] is. I'd like to hug him so hard!"); Mes.Add("[gn:" + GuardianBase.Leopold + "] asked me earlier If I could do a test to check for Hyperactivity. ???"); if (!player.Male) { Mes.Add("Do you like touching [gn:" + GuardianBase.Leopold + "]'s tail too? It's soft!"); } } if (NpcMod.HasGuardianNPC(GuardianBase.Vladimir)) { Mes.Add("You didn't saw me last night? Sorry, I was sleeping on [gn:" + GuardianBase.Vladimir + "]'s arms during the entire night. His hug is warm."); Mes.Add("Everytime [gn:" + GuardianBase.Vladimir + "] hugs someone, he looks very happy and satisfied. I think he really loves that."); Mes.Add("A number of people in the town thinks that [gn:" + GuardianBase.Vladimir + "] hugging people is exquisite, but I saw them being hugged by him too."); } if (NpcMod.HasGuardianNPC(GuardianBase.Malisha)) { Mes.Add("I'm trying my best not to hate [gn:" + Malisha + "], but she keeps turning me into a different critter whenever I try to pet her."); Mes.Add("Do you think [gn:" + Malisha + "] hates me? Yeah, I think not too."); } int GNPCCount = NpcMod.GetTerraGuardianNPCCount(); if (GNPCCount >= 10) { Mes.Add("So many TerraGuardians around! It's like my personal heaven! Thank you! Thank you for finding them!"); Mes.Add("I love this place, so many cute and different looking TerraGuardians! This place is my gift!"); } if (GNPCCount >= 5) { Mes.Add("There's a lot of TerraGuardians here, I like that! Too many options of things to pet."); Mes.Add("Everywhere I go, I see a TerraGuardian walking around going to some place, or hanging around somewhere. I love It!"); } if (GNPCCount >= 1 && GNPCCount < 5) { Mes.Add("I liked to meet the TerraGuardians, I wonder If there are more around."); } if (guardian.IsPlayerRoomMate(player)) { Mes.Add("Yes! I can share my room with you. We could play pillow fight sleeping."); Mes.Add("I like having you as a room mate, but I would like having a TerraGuardian more."); } } if (guardian.Downed) { Mes.Clear(); Mes.Add("(She's motionless in the floor. She's still breathing.)"); Mes.Add("(You can notice her trying to endure the pain.)"); } else if (guardian.IsSleeping) { Mes.Clear(); Mes.Add("(She's moving her hands, like as if she was petting something.)"); Mes.Add("(You notice her blushing, and with a happy face, she must be in the middle of many TerraGuardians.)"); } if (FlufflesBase.IsHauntedByFluffles(player) && Main.rand.NextDouble() < 0.75) { Mes.Clear(); Mes.Add("Why there is a TerraGuardian on your shoulder?"); } return(Mes[Main.rand.Next(Mes.Count)]); }
public override string NormalMessage(Player player, TerraGuardian guardian) { List <string> Mes = new List <string>(); if (FlufflesBase.IsHauntedByFluffles(player) && Main.rand.NextDouble() < 0.75) { Mes.Add("*Oh, hey....[nickname]. What do you wa-AAAHHHHH!! A GHOST!!! BEHIND YOU!!*"); Mes.Add("*Waah!! What is that!! On your back!!*"); } else if (guardian.IsSleeping) { Mes.Add("*Aaahhh!! No!! Go away!! Yaaaa!!!* (He seems to be having nightmares.)"); Mes.Add("*No! I don't want!! Don't push meeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee....* (He seems to be having nightmares)"); Mes.Add("*Please... Stop... Go away...* (He's moving from a lot while sleeping.)"); } else if (guardian.IsUsingToilet) { Mes.Add("*This... Is really... Uncomfortable... With you... Like.... Watching...*"); Mes.Add("*Aaahhh!! (Loud noise) Uh... That helped... Go away... Please..?*"); } else { Mes.Add("*Aaah!! Oh! It's you.*"); Mes.Add("*H- Hi! You caught me off guard.*"); Mes.Add("*Ahh!! Don't care me.*"); Mes.Add("*Who approaches?! Ah, [nickname]. Phew...*"); Mes.Add("*No!! Don't!! Oh.. It's just you.*"); Mes.Add("*My heart is constantly racing. This is not good at all.*"); Mes.Add("*Everything, anything, scares me. Includding you. You wont do something bad or scary, are you?*"); Mes.Add("*I need my space, why are you so close!?*"); Mes.Add("*Hey! Stay away from me!*"); Mes.Add("*I have nothing to discuss. You should be on your way far from me.*"); Mes.Add("*Hey! Stop moving around so much, it's giving me anxiety.*"); Mes.Add("*Just existing around here gives me the creeps.*"); if (Main.dayTime) { if (Main.eclipse) { Mes.Add("*No more!! Please end this horrible day!!*"); Mes.Add("*It's way too scary!! I want to lock myself at home!*"); Mes.Add("*Get them away from me! Get them away from me!*"); } else { Mes.Add("*I keep looking around, I never know when something may try to jump out on me.*"); Mes.Add("*At least I can spot far away things at this time.*"); } } else { if (Main.bloodMoon) { Mes.Add("*This is a horrible night to be here!! HEEEEEEEEELP!!!*"); Mes.Add("*There is something wrong! Everything is red, and there's several monsters outside!*"); } else { Mes.Add("*It's way too dark! Anything could come out of the dark.*"); Mes.Add("*I don't think I'll have a good night of sleep like this.*"); } } if (Main.raining) { Mes.Add("*At least the rain sound isn't that sca- (Kabroom!!!) Yikes!!*"); Mes.Add("*I can't relax any moment, those thunders always scares me.*"); } if (NpcMod.HasGuardianNPC(Rococo)) { Mes.Add("*Please tell [gn:" + Rococo + "] to stop staring at me! His quiet nature doesn't fool me!.*"); } if (NpcMod.HasGuardianNPC(Brutus)) { Mes.Add("*[gn:" + Brutus + "] seems to be good meat sheild, lets exploit that to our advantage.*"); Mes.Add("*Even with [gn:" + Brutus + "] here, I can't feel entirelly safe.*"); Mes.Add("*My only use for [gn:" + Brutus + "] is a sheild.*"); } if (NpcMod.HasGuardianNPC(Malisha)) { Mes.Add("*I dislike wandering outside at night. Beside the zombies and other horrible creatures, there's also [gn:" + Malisha + "] too. Just speaking to her makes me feel in danger.*"); } if (NpcMod.HasGuardianNPC(Leopold)) { if (player.GetModPlayer <PlayerMod>().TalkedToLeopoldAboutThePigs) { Mes.Add("*I'm... Fragmented? Just that thought makes me nervous.*"); } else { Mes.Add("*It seems like [gn:" + Leopold + "] really wants to ask many things, but I can't trust him too much, he could be planning something.*"); } } if (NpcMod.HasGuardianNPC(Fluffles)) { Mes.Add("*Fox ghost!*"); } if (NpcMod.HasGuardianNPC(Wrath)) { Mes.Add("*Make sure [gn:" + Wrath + "] stay VERY, VERY far away from me! They are a menace and should be caged up.*"); } if (NpcMod.HasGuardianNPC(Joy)) { Mes.Add("*I don't care how nice [gn:" + Joy + "] may seem, they are just trying to gain my trust now to hurt me later!*"); } /*if (NpcMod.HasGuardianNPC(Sadness)) * { * Mes.Add("*[gn:" + Sadness + "]*"); * }*/ if (NpcMod.HasGuardianNPC(Miguel)) { Mes.Add("*Those abs on [gn:" + Miguel + "] are menacing!*"); } if (guardian.IsPlayerRoomMate(player)) { Mes.Add("*You... You will protect me at night, right? You know... Under bed monsters? Closet monsters? And those things?*"); Mes.Add("*Sharing the house with you is not the best idea. Just please, don't make weird noises it makes me anxious.*"); } } return(Mes[Main.rand.Next(Mes.Count)]); }
public override string ReviveMessage(TerraGuardian Guardian, bool IsPlayer, Player RevivePlayer, TerraGuardian ReviveGuardian) { List <string> Mes = new List <string>(); if (IsPlayer) { Mes.Add("Come on! You can't be a hero by lying down."); Mes.Add("I think that's not the worst beating you can get."); Mes.Add("You're not doing that on purpose, right?"); } else { if (ReviveGuardian.Base.IsTerraGuardian) { Mes.Add("*Petting intensifies*"); Mes.Add("Sooooooo cuuuuute!!"); Mes.Add("Awww... You're even cuter when knocked out."); } else { Mes.Add("Are you fine? I'll try helping you."); Mes.Add("Here, I'll try doing something about those wounds."); } } return(Mes[Main.rand.Next(Mes.Count)]); }
public override string CompanionRecruitedMessage(TerraGuardian WhoReacts, GuardianData WhoJoined, out float Weight) { Weight = 1f; return("*They're somewhat friendly I guess?*"); }
public override string ReviveMessage(TerraGuardian Guardian, bool IsPlayer, Player RevivePlayer, TerraGuardian ReviveGuardian) { List <string> Mes = new List <string>(); Mes.Add("*Nobody coming near? I hope so...*"); Mes.Add("*Come on... Faster....*"); Mes.Add("*I hope I'm doing this right...*"); Mes.Add("*Come on... Breath....*"); Mes.Add("*Get up! Get up! You need to protect me!*"); return(Mes[Main.rand.Next(Mes.Count)]); }
public override string ReviveMessage(TerraGuardian Guardian, bool IsPlayer, Player RevivePlayer, TerraGuardian ReviveGuardian) { List <string> Mes = new List <string>(); Mes.Add("*I know some healing magic, this will help you.*"); Mes.Add("*I've read several medicine books. Don't worry, I know what I'm doing.*"); Mes.Add("*I hope I don't need to open you up to try fixing a problem.*"); if (!IsPlayer && ReviveGuardian.ModID == Guardian.ModID) { if (ReviveGuardian.ID == GuardianBase.Blue) { Mes.Add("*I should help her carefully away, I don't want to be stuck in her arms for hours again.*"); } if (ReviveGuardian.ID == GuardianBase.Vladimir) { Mes.Add("*There is still a lot you can help me with.*"); } if (ReviveGuardian.ID == GuardianBase.Zacks) { Mes.Add("*Come on " + Guardian.Name + ", control your intestine. You need to help him, no time for... Leaf, please.*"); } if (ReviveGuardian.ID == GuardianBase.Mabel) { Mes.Add("*Oh no... My nose... Someone has a leaf I could use?*"); } if (ReviveGuardian.ID == GuardianBase.Malisha) { Mes.Add("*Ugh... I really don't want to... But... I'll help...*"); Mes.Add("*I hope she stops tormenting me after this.*"); } } return(Mes[Main.rand.Next(Mes.Count)]); }
public void StareAt(TerraGuardian tg) { Idle = false; npc.direction = tg.Position.X - npc.Center.X < 0 ? -1 : 1; }
public override string NormalMessage(Player player, TerraGuardian guardian) { List <string> Mes = new List <string>(); if (!Main.bloodMoon) { Mes.Add("I have no emotion, no memory, neither a physical body."); } else { Mes.Add("This night looks perfect for some random violence."); Mes.Add("Don't worry about me, I don't feel fear, or any other emotion."); } if (Main.eclipse) { Mes.Add("Those creatures seems to have spawned from a flat screen."); } Mes.Add("I can wear any outfit you give me, just leave it on the first slots of my inventory."); Mes.Add("I don't have any goal, so I set my own goal to be of helping you on your quest."); Mes.Add("I have become so numb."); Mes.Add("Should I worry that you could make me look ridiculous?"); Mes.Add("I am now your shadow, whenever you need, I will go with you, even if it means my demise."); Mes.Add("I were in this world for too long, I have seen several things that happened here."); if (Main.dayTime && !Main.eclipse) { Mes.Add("The clothings I have are like my body parts, since they are visible all time. But that doesn't seems to help making the other citizens feel less alarmed about my presence."); } if (NPC.AnyNPCs(Terraria.ID.NPCID.Guide)) { Mes.Add("[nn:" + Terraria.ID.NPCID.Guide + "] doesn't appreciate the fact that I know more things than him."); } if (!Main.dayTime && !Main.bloodMoon) { Mes.Add("It's night, I don't feel sleepy."); Mes.Add("Doesn't matter if It's day or night, I still am partially invisible anytime."); } if (Terraria.GameContent.Events.BirthdayParty.PartyIsUp) { Mes.Add("Everyone seems to be expressing themselves on this party. Me? I'll just stay drinking."); } if (NPC.AnyNPCs(Terraria.ID.NPCID.Clothier)) { Mes.Add("You have emotions, right? What should I be feeling after hearing that [nn:" + Terraria.ID.NPCID.Clothier + "] is a lady killer?"); } if (NpcMod.HasGuardianNPC(1)) { Mes.Add("[gn:1] keeps forgetting to look where she sits."); } if (NpcMod.HasGuardianNPC(2)) { Mes.Add("I told [gn:2] that I don't feel anything about drinking, after he asked me about going out for a drink sometime."); } if (NpcMod.HasGuardianNPC(3)) { Mes.Add("Everyone seems uncomfortable about having [gn:3] and me around. I don't know where is the problem."); } if (NpcMod.HasGuardianNPC(0)) { Mes.Add("[gn:0] always runs away when he sees me. Did I do something to him?"); } if (NpcMod.HasGuardianNPC(5)) { Mes.Add("Before you ask: No, I'm not " + AlexRecruitScripts.AlexOldPartner + ", but I once saw a cheerful woman playing with him during my night stalking a long time ago."); Mes.Add("I don't know what it feels by tossing a ball to make [gn:5] fetch it. I just do it because he askes me to."); } if (NpcMod.HasGuardianNPC(2) && NpcMod.HasGuardianNPC(7)) { Mes.Add("I don't know what is love, or what it is to feel love, but I think [gn:2] and [gn:7] have a very divergent and disturbed relationship."); } if (NpcMod.HasGuardianNPC(8)) { Mes.Add("I always win the stare contest, because [gn:8] ends up laughing after a few minutes staring my face. I don't know why."); Mes.Add("I think [gn:8] is super effective on the town, since she atracts attention of almost everyone in the town. Me? I don't care. \"Sips coffee\""); } if (NpcMod.HasGuardianNPC(Fluffles)) { Mes.Add("What? [gn:" + Fluffles + "] wasn't doing a stare contest?"); Mes.Add("No. [gn:" + Fluffles + "] and I are different. Her soul wasn't devoured by a vile creature."); } if (guardian.IsPlayerRoomMate(player)) { Mes.Add("I don't mind sharing the room with you. There's enough space."); Mes.Add("If you get a bed for yourself, you are free to stay as long as you want."); } return(Mes[Main.rand.Next(Mes.Count)]); }
public override void WhenGuardianUses(TerraGuardian guardian) { guardian.Data.ResetSkillsProgress(); }
public override string ReviveMessage(TerraGuardian Guardian, bool IsPlayer, Player RevivePlayer, TerraGuardian ReviveGuardian) { List <string> Mes = new List <string>(); if (IsPlayer && RevivePlayer.whoAmI == Guardian.OwnerPos) { Mes.Add("I wont copy that, seems shameful."); Mes.Add("Are you supposed to stay lying down on the floor?"); Mes.Add("Those wounds will be taken care of."); } else { Mes.Add("You will be back soon."); Mes.Add("I'll take care of this."); Mes.Add("You look exausted."); } return(Mes[Main.rand.Next(Mes.Count)]); }
public override void AI() { AlexRecruitScripts.AlexNPCPosition = npc.whoAmI; const int Distance = 1024; int SpawnPosX = AlexRecruitScripts.TombstoneTileX * 16, SpawnPosY = AlexRecruitScripts.TombstoneTileY * 16; bool MoveLeft = false, MoveRight = false, Jump = false, Dash = false; string TextToSay = ""; bool PlayerOnFloor = false; npc.npcSlots = 1; switch ((int)npc.ai[AI_TYPE]) { case 0: //Wait for Player npc.TargetClosest(true); bool TeleportToSpawn = false; if (npc.target > -1) { Player player = Main.player[npc.target]; PlayerIsMale = player.Male; Rectangle FoV = new Rectangle(0, -150, 250, 300); if (npc.direction < 0) { FoV.X -= FoV.Width; } FoV.X += (int)npc.Center.X; FoV.Y += (int)npc.Center.Y; if (FoV.Intersects(player.getRect()) && Collision.CanHitLine(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { //Chase Player npc.ai[AI_TYPE] = 1; npc.ai[AI_TIMER] = 0; } else { //Keep looking for player float XDifference = SpawnPosX - npc.Center.X, YDifference = SpawnPosY - npc.Center.Y; if (Math.Abs(XDifference) >= NPC.sWidth || Math.Abs(YDifference) >= NPC.sHeight) { TeleportToSpawn = true; } else if (Math.Abs(XDifference) >= 16 || Math.Abs(YDifference) >= npc.height) { if (XDifference < 0) { MoveLeft = true; } else { MoveRight = true; } } } } else { TeleportToSpawn = Math.Abs(npc.Center.X - SpawnPosX) >= 16 || Math.Abs(npc.Center.Y - SpawnPosY) >= npc.height; } if (TeleportToSpawn) { npc.position.X = AlexRecruitScripts.TombstoneTileX - npc.width * 0.5f; npc.position.Y = AlexRecruitScripts.TombstoneTileY - npc.height; } break; case 1: if (npc.target == -1) { npc.ai[AI_TYPE] = 0; npc.ai[AI_TIMER] = 0; } else { Player player = Main.player[npc.target]; float XDifference = player.Center.X - npc.Center.X, YDifference = player.Center.Y - npc.Center.Y; if (Math.Abs(XDifference) >= NPC.sWidth || Math.Abs(YDifference) >= NPC.sHeight) { //TeleportToSpawn = true; npc.ai[AI_TYPE] = 0; npc.ai[AI_TIMER] = 0; } else { if (XDifference < 0) { MoveLeft = true; } else { MoveRight = true; } if (npc.velocity.Y == 0 && Math.Abs(XDifference) <= AlexGuardianBase.Width * 2 + AlexGuardianBase.JumpSpeed * 2) { Jump = true; } if (npc.Hitbox.Intersects(player.getRect())) { npc.ai[AI_TYPE] = 2; npc.ai[AI_TIMER] = 0; MessageTime = 30; if (Main.halloween) { MainMod.TriggerAlexJS(); } if (!PlayerMod.PlayerHasGuardian(Main.player[Main.myPlayer], AlexID)) { PlayerOnFloor = true; } if (PlayerMod.PlayerMountedOnGuardian(Main.player[Main.myPlayer])) { Main.player[Main.myPlayer].GetModPlayer <PlayerMod>().MountGuardian.ToggleMount(true, false); } } } } break; case 2: //Speaks with player { npc.npcSlots = 200; if (npc.target == -1) { //Go to the chat where he asks where the player went, then return to AI 0; npc.ai[AI_TYPE] = 3; npc.ai[AI_TIMER] = 0; } else { if (npc.velocity.X != 0 || npc.velocity.Y != 0) //Only chat when lands. { break; } int DialogueTimer = (int)npc.ai[AI_TIMER] / 30; bool Trigger = npc.ai[AI_TIMER] % 30 == 15; bool HasAlreadyGuardian = false; if (PlayerMod.PlayerHasGuardian(Main.player[Main.myPlayer], AlexID)) { HasAlreadyGuardian = true; } if (Trigger) { if (HasAlreadyGuardian) { switch (DialogueTimer / 5) { case 0: TextToSay = "Hey buddy-buddy!"; break; case 1: TextToSay = "It's good to see your face again."; break; case 2: TextToSay = "Anything you want, I'm here to protect you."; break; case 3: NpcMod.AddGuardianMet(AlexID); WorldMod.TurnNpcIntoGuardianTownNpc(npc, AlexID); //npc.Transform(ModContent.NPCType<GuardianNPC.List.GiantDogGuardian>()); break; } } else { switch (DialogueTimer) { case 0: TextToSay = "Hello! Who are you?"; break; case 5: TextToSay = "Are you my new friend? Do you want to be my friend?"; break; case 10: TextToSay = "You're saying that I'm crushing your chest? Oh! My bad!"; break; case 12: npc.velocity.X -= 15f * npc.direction; npc.velocity.Y -= AlexGuardianBase.JumpSpeed; break; case 15: TextToSay = "By the way, I'm " + AlexGuardianBase.Name + ", let's go on an adventure."; break; case 20: //Guardian GET! PlayerMod.AddPlayerGuardian(Main.player[npc.target], AlexID); PlayerMod.GetPlayerGuardian(Main.player[npc.target], AlexID).IncreaseFriendshipProgress(1); WorldMod.TurnNpcIntoGuardianTownNpc(npc, AlexID); NpcMod.AddGuardianMet(AlexID); break; } } } if (!HasAlreadyGuardian && DialogueTimer < 12) { PlayerOnFloor = true; } if (HasAlreadyGuardian) { float XDifference = Main.player[Main.myPlayer].Center.X - npc.Center.X; if (Math.Abs(XDifference) > AlexGuardianBase.Width) { if (XDifference > 0) { MoveRight = true; } else { MoveLeft = true; } } } npc.ai[AI_TIMER]++; } } break; case 3: //Player disappeared/is missing chat { int DialogueTimer = (int)npc.ai[AI_TIMER] / 30; bool Trigger = npc.ai[AI_TIMER] % 30 == 15; if (Trigger) { if (DialogueTimer == 3) { TextToSay = "Where did " + (PlayerIsMale ? "he" : "she") + " go?"; } if (DialogueTimer == 7) { TextToSay = "Better I go guard the tombstone then..."; } if (DialogueTimer == 13) { npc.ai[AI_TYPE] = 0; npc.ai[AI_TIMER] = 0; } } npc.ai[AI_TIMER]++; } break; } if (npc.target > -1) { Player player = Main.player[npc.target]; TerraGuardian guardian = player.GetModPlayer <PlayerMod>().Guardian; if (PlayerOnFloor) { Vector2 NewPlayerPosition = Vector2.Zero; NewPlayerPosition.X = npc.Center.X + (26) * npc.direction; NewPlayerPosition.Y = npc.position.Y + npc.height; player.fullRotationOrigin.X = player.width * 0.5f; player.fullRotationOrigin.Y = player.height * 0.5f; player.velocity = Vector2.Zero; if (player.mount.Active) { player.mount.Dismount(player); } if (npc.velocity.Y != 0) { player.fullRotation = npc.direction * MathHelper.ToRadians(45); } else { player.fullRotation = npc.direction * MathHelper.ToRadians(90); } player.gfxOffY = -2; player.Center = NewPlayerPosition; player.direction = -npc.direction; player.immuneTime = 30; player.immuneNoBlink = true; player.fallStart = (int)player.position.Y / 16; player.breath = player.breathMax; player.statLife++; if (player.statLife > player.statLifeMax2) { player.statLife = player.statLifeMax2; } if (guardian.Active) { if (guardian.PlayerMounted) { guardian.PlayerMounted = false; } if (guardian.PlayerControl) { guardian.ImmuneTime = 5; guardian.Rotation = player.fullRotation; guardian.Position.X = player.position.X - guardian.Height * 0.5f * npc.direction; guardian.Position.Y = player.position.Y + guardian.Width * 0.25f;// -guardian.Width * 0.5f; } } } else if (LastOnFloor) { player.fullRotation = 0; player.velocity.Y -= 6.5f; player.direction = -npc.direction; player.fullRotationOrigin = Vector2.Zero; if (guardian.Active) { if (guardian.PlayerControl) { guardian.Rotation = player.fullRotation; guardian.Position.X = player.position.X; guardian.Position.Y = player.position.Y;// -guardian.Height * 0.5f; guardian.Velocity = player.velocity; } } } } LastOnFloor = PlayerOnFloor; float Acceleration = AlexGuardianBase.Acceleration, MaxSpeed = AlexGuardianBase.MaxSpeed, Deceleration = AlexGuardianBase.SlowDown, JumpSpeed = AlexGuardianBase.JumpSpeed; if (Dash) { MaxSpeed *= 2; Acceleration *= 2; } int MaxJumpHeight = AlexGuardianBase.MaxJumpHeight; if (MoveLeft) { npc.direction = -1; npc.velocity.X -= Acceleration; if (npc.velocity.X < -MaxSpeed) { npc.velocity.X = -MaxSpeed; } if (npc.collideX && npc.velocity.Y == 0) { Jump = true; } } if (MoveRight) { npc.direction = 1; npc.velocity.X += Acceleration; if (npc.velocity.X > MaxSpeed) { npc.velocity.X = MaxSpeed; } if (npc.collideX && npc.velocity.Y == 0) { Jump = true; } } if (!MoveRight && !MoveLeft) { if (npc.velocity.X > 0) { npc.velocity.X -= Deceleration; if (npc.velocity.X < 0) { npc.velocity.X = 0; } } if (npc.velocity.X < 0) { npc.velocity.X += Deceleration; if (npc.velocity.X > 0) { npc.velocity.X = 0; } } } if (Jump) { if (JumpTime == 0) { if (npc.velocity.Y == 0) { JumpTime = MaxJumpHeight; npc.velocity.Y -= JumpSpeed; } } else { if (npc.collideY) { JumpTime = 0; } else { JumpTime--; npc.velocity.Y -= JumpSpeed; } } } else { if (JumpTime != 0) { JumpTime = 0; } } float StepSpeed = 2f, gfxOffY = 0f; Collision.StepUp(ref npc.position, ref npc.velocity, npc.width, npc.height, ref StepSpeed, ref gfxOffY); Vector4 SlopedCollision = Collision.SlopeCollision(npc.position, npc.velocity, npc.width, npc.height, 1f, false); npc.position = SlopedCollision.XY(); npc.velocity = SlopedCollision.ZW(); if (TextToSay != "") { MessageTime = 300; MessageText = TextToSay; /*if (Main.netMode == 0) * { * Main.NewText("Giant Dog: " + TextToSay); * } * else * { * * }*/ } }
public override string CompanionRecruitedMessage(TerraGuardian WhoReacts, GuardianData WhoJoined, out float Weight) { Weight = 0.8f; return("..."); }
public override string NoRequestMessage(Player player, TerraGuardian guardian) { return("Bark! Bark! (She looks okay right now.)"); }
public override void Update(TerraGuardian guardian) { if (guardian.OwnerPos == -1) { InUse = false; return; } if (!PlayerWasKnockedOut && guardian.AfkCounter < 60) { InUse = false; return; } if (guardian.UsingFurniture) { guardian.LeaveFurniture(false); } Player defended = Main.player[guardian.OwnerPos]; PlayerMod defendedPm = defended.GetModPlayer <PlayerMod>(); /*if (guardian.GrabbingPlayer) * { * guardian.PlayerCanEscapeGrab = true; * DelayBeforePlacingOnTheGround--; * if (guardian.Velocity.X != 0 || guardian.Velocity.Y != 0) * DelayBeforePlacingOnTheGround = 5 * 60; * return; * } * { * int XStart = (int)(defended.position.X * (1f / 16)), XEnd = (int)((defended.position.X + defended.width) * (1f / 16)); * int YCheck = (int)(defended.position.Y * (1f / 16)); * bool TryPickingUpPlayer = false; * for (int x = XStart; x < XEnd; x++) * { * if(MainMod.IsDangerousTile(x, YCheck, defended.fireWalk)) * { * TryPickingUpPlayer = true; * break; * } * } * if (TryPickingUpPlayer) * { * DelayBeforePlacingOnTheGround = 5 * 60; * if(TryReachingPlayer(guardian, defended)) * { * guardian.AttemptToGrabPlayer(); * } * return; * } * }*/ const int Offset = 7 * 2; float DefendX = defended.Center.X - Offset * defended.direction; if (defendedPm.KnockedOut && (defendedPm.BeingCarriedByGuardian || (defendedPm.ControllingGuardian && defendedPm.Guardian.BeingCarriedByGuardian))) { Action = 2; } if (Action == 2) { if (guardian.Position.X + guardian.Velocity.X * 0.5f > DefendX) { guardian.MoveLeft = true; } else { guardian.MoveRight = true; } PlayerMod pm = defendedPm; if (pm.ControllingGuardian) { pm.Guardian.AddBuff(ModContent.BuffType <Buffs.Defended>(), 3, true); if (pm.Guardian.KnockedOut) { pm.Guardian.ReviveBoost++; } else { if (guardian.AfkCounter < ProtectModeAutoTriggerTime && PlayerWasKnockedOut) { InUse = false; } } if (!pm.Guardian.BeingCarriedByGuardian) { Action = 0; } } else { defended.AddBuff(ModContent.BuffType <Buffs.Defended>(), 3); if (pm.KnockedOut) { pm.ReviveBoost++; } else { if (guardian.AfkCounter < ProtectModeAutoTriggerTime && PlayerWasKnockedOut) { InUse = false; } } if (pm.BeingCarriedByGuardian) { Action = 0; } } } else if (Action == 0) { if (guardian.PlayerMounted || guardian.SittingOnPlayerMount) { Action = 1; } else { guardian.MoveLeft = guardian.MoveRight = false; if (guardian.Position.X + guardian.Velocity.X * 0.5f > DefendX) { guardian.MoveLeft = true; } else { guardian.MoveRight = true; } if (Math.Abs(guardian.Position.X - DefendX) < 5 && Math.Abs(guardian.Velocity.X) < 3f) { Action = 1; if (defendedPm.ControllingGuardian) { if (defendedPm.Guardian.ModID == MainMod.mod.Name) { switch (defendedPm.Guardian.ID) { case GuardianBase.Domino: { switch (Main.rand.Next(5)) { case 0: guardian.SaySomething("*I'm only protecting him because of you, [nickname].*"); break; case 1: guardian.SaySomething("*Of anyone you could take direct control, It had to be him?*"); break; case 2: guardian.SaySomething("*Is this some kind of karma?*"); break; case 3: guardian.SaySomething("*Okay, what have I done to you, [nickname]?*"); break; case 4: guardian.SaySomething("*It's funny how I'm treating his wounds, instead of beating his face.*"); break; } } break; } } } } } } else if (Action == 1) { if (!guardian.PlayerMounted && !guardian.SittingOnPlayerMount) { guardian.Position.X = DefendX; if (!guardian.IsAttackingSomething) { guardian.LookingLeft = defended.direction == -1; } } guardian.Jump = false; if (!guardian.SittingOnPlayerMount) { guardian.MoveDown = true; } guardian.OffHandAction = true; PlayerMod pm = defendedPm; if (pm.ControllingGuardian) { pm.Guardian.AddBuff(ModContent.BuffType <Buffs.Defended>(), 3, true); if (pm.Guardian.KnockedOut) { pm.Guardian.ReviveBoost++; } else { if (guardian.AfkCounter < ProtectModeAutoTriggerTime && PlayerWasKnockedOut) { InUse = false; } } } else { defended.AddBuff(ModContent.BuffType <Buffs.Defended>(), 3); if (pm.KnockedOut) { pm.ReviveBoost++; } else { if (guardian.AfkCounter < ProtectModeAutoTriggerTime && PlayerWasKnockedOut) { InUse = false; } } } } }
public override string CompletedRequestMessage(Player player, TerraGuardian guardian) { return("(She started licking you, she seems really happy.)"); }
public override void ItemStatusScript(TerraGuardian g) { g.SummonDamageMultiplier += 0.15f; }
public override string ReviveMessage(TerraGuardian Guardian, bool IsPlayer, Player RevivePlayer, TerraGuardian ReviveGuardian) { switch (Main.rand.Next(3)) { default: return("Whine... Whine... Whine..."); case 1: return("(Licking the injured person)"); case 2: return("... Bark! Bark! Whine... Whine...."); } }
public override void ItemStatusScript(TerraGuardian g) { g.AddFlag(GuardianFlags.GoldenShowerStance); }
public override void Update(TerraGuardian guardian) { IgnoreCombat = true; AvoidItemUsage = true; if (guardian.UsingFurniture) { guardian.LeaveFurniture(); } switch (Step) { case 0: if (StepStart) { if (Main.rand.NextDouble() < 0.01f) { Main.PlaySound(29, (int)guardian.Position.X, (int)guardian.CenterY, 89); } guardian.DisplayEmotion(TerraGuardian.Emotions.Question); int ItemPosition = BoxPosition; BoxID = guardian.Inventory[BoxPosition].type; guardian.Inventory[ItemPosition].SetDefaults(0, true); } if (Time >= 120) { ChangeStep(); } break; case 1: if (StepStart) { guardian.DisplayEmotion(TerraGuardian.Emotions.Alarmed); } if (Time % 20 == 0) { //Spawn item every 5 ticks; int ItemID = Terraria.ID.ItemID.CopperCoin, Stack = Main.rand.Next(10, 26); if (Main.rand.Next(100) == 0) { ItemID = Terraria.ID.ItemID.PlatinumCoin; Stack = Main.rand.Next(1, 3); } else if (Main.rand.Next(25) == 0) { ItemID = Terraria.ID.ItemID.GoldCoin; Stack = Main.rand.Next(3, 5); } else if (Main.rand.Next(5) == 0) { ItemID = Terraria.ID.ItemID.SilverCoin; Stack = Main.rand.Next(5, 20); } else if (Main.rand.Next(5) == 0) { ItemID = Terraria.ID.ItemID.WoodenCrate; Stack = Main.rand.Next(3, 6); } else if (Main.rand.Next(15) == 0) { ItemID = Terraria.ID.ItemID.IronCrate; Stack = Main.rand.Next(2, 4); } else if (Main.rand.Next(25) == 0) { ItemID = Terraria.ID.ItemID.GoldenCrate; Stack = Main.rand.Next(1, 3); } else if (Main.rand.Next(3) == 0) { ItemID = Terraria.ID.ItemID.HerbBag; Stack = 1; } Item.NewItem(guardian.CenterPosition, ItemID, Stack); } if (Time >= 120) { ChangeStep(); } break; case 2: if (StepStart) { guardian.DisplayEmotion(TerraGuardian.Emotions.Happy); guardian.IncreaseFriendshipProgress(5); guardian.Data.GiftGiven = true; InUse = false; } break; } }
public override void AI() { if (Main.netMode < 2 && FirstFrame) { FirstFrame = false; if (PlayerMod.PlayerHasGuardian(Main.player[Main.myPlayer], GuardianID, GuardianModID)) { GuardianData gd = PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], GuardianID, GuardianModID); AgeScale = TerraGuardian.GetAgeSizeValue(gd.GetRealAgeDecimal()); } else { float AgeValue = TerraGuardian.GetAgeDecimalValue(Base.Age, Base.Birthday, GuardianGlobalInfos.LifeTime, Base.GetGroup.AgingSpeed); AgeScale = TerraGuardian.GetAgeSizeValue(AgeValue); } } npc.scale = AgeScale * Base.GetScale; if (MessageTime > 0) { MessageTime--; } float Acceleration = Base.Acceleration, MaxSpeed = Base.MaxSpeed, Deceleration = Base.SlowDown, JumpSpeed = Base.JumpSpeed; for (int i = 0; i < 255; i++) { if (Main.player[i].talkNPC == npc.whoAmI) { Idle = false; StareAt(Main.player[i]); break; } } if (Idle) { if (npc.direction == 0) { npc.TargetClosest(true); //npc.direction = (Main.rand.NextDouble() < 0.5 ? -1 : 1); } if (IdleBehaviorTime <= 0) { IdleBehaviorType = (byte)Main.rand.Next(2); IdleBehaviorTime = 200 + Main.rand.Next(200); npc.direction *= -1; } if (IdleBehaviorType == 1) { Walk = true; if (npc.direction > 0) { MoveRight = true; } else { MoveLeft = true; } } IdleBehaviorTime--; if (MoveLeft || MoveRight) { bool HasTileInFront = false; for (int x = 0; x < 3; x++) { for (int y = 0; y < 4; y++) { int Tx = (int)npc.Center.X / 16 + (2 + x) * npc.direction, Ty = (int)npc.Bottom.Y / 16 + y; Tile tile = MainMod.GetTile(Tx, Ty); if (tile.active() && (Main.tileSolid[tile.type] || Main.tileSolidTop[tile.type])) { HasTileInFront = true; break; } } } if (!HasTileInFront) { if (MoveRight) { MoveRight = false; MoveLeft = true; } else { MoveRight = true; MoveLeft = false; } } } } if (Walk) { Acceleration = TerraGuardian.WalkAcceleration; MaxSpeed = TerraGuardian.WalkMaxSpeed; Deceleration = TerraGuardian.WalkSlowDown; } else if (Dash) { MaxSpeed *= 2; Acceleration *= 2; } int MaxJumpHeight = Base.MaxJumpHeight; if (MoveLeft) { npc.direction = -1; npc.velocity.X -= Acceleration; if (npc.velocity.X < -MaxSpeed) { npc.velocity.X = -MaxSpeed; } if (npc.collideX && npc.velocity.Y == 0) { Jump = true; } } if (MoveRight) { npc.direction = 1; npc.velocity.X += Acceleration; if (npc.velocity.X > MaxSpeed) { npc.velocity.X = MaxSpeed; } if (npc.collideX && npc.velocity.Y == 0) { Jump = true; } } if (!MoveRight && !MoveLeft) { if (npc.velocity.X > 0) { npc.velocity.X -= Deceleration; if (npc.velocity.X < 0) { npc.velocity.X = 0; } } if (npc.velocity.X < 0) { npc.velocity.X += Deceleration; if (npc.velocity.X > 0) { npc.velocity.X = 0; } } } if (Jump) { if (JumpTime == 0) { if (npc.velocity.Y == 0) { JumpTime = MaxJumpHeight; npc.velocity.Y = -JumpSpeed; } } else { if (npc.collideY) { JumpTime = 0; } else { JumpTime--; npc.velocity.Y = -JumpSpeed; } } } else { if (JumpTime != 0) { JumpTime = 0; } } IsWalking = Walk; MoveLeft = MoveRight = DropFromPlatform = Jump = Action = Dash = Walk = Idle = false; Collision.StepUp(ref npc.position, ref npc.velocity, npc.width, npc.height, ref npc.stepSpeed, ref npc.gfxOffY); Vector4 SlopedCollision = Collision.SlopeCollision(npc.position, npc.velocity, npc.width, npc.height, 1f, false); npc.position = SlopedCollision.XY(); npc.velocity = SlopedCollision.ZW(); }
public override void Update(TerraGuardian guardian) { if (Main.dayTime || Main.time >= 28800) { InUse = false; return; } if (guardian.OwnerPos > -1 && guardian.AfkCounter < 60) { InUse = false; return; } if (guardian.IsAttackingSomething) { return; } switch (Behavior) { case 0: //Wander { if (Time <= 0) { Tile tile = MainMod.GetTile((int)(guardian.Position.X * (1f / 16)), (int)(guardian.CenterY * (1f / 16))); if (tile.wall > 0) { Time = 400; } else if (guardian.HasDoorOpened) { Time = 50; } else { Behavior = 1; Time = 2000; break; } } if (guardian.OwnerPos == -1) { guardian.WalkMode = true; if (guardian.LookingLeft) { guardian.MoveLeft = true; } else { guardian.MoveRight = true; } } Time--; } break; case 1: //Howl { if (Time <= 0) { guardian.LookingLeft = Main.rand.NextDouble() < 0.5; Behavior = 0; Time = 400; break; } if (Time == 890 || Time == 1300 || Time == 1900) { guardian.SaySomething("Awooooooo!!!"); } Time--; } break; } }
private void BlueQuestEpilogueDialogue() { BlueQuestData data = (BlueQuestData)Data; TerraGuardian Blue = Dialogue.GetSpeaker; TerraGuardian Zacks = PlayerMod.GetPlayerSummonedGuardian(Main.LocalPlayer, GuardianBase.Zacks); if (Zacks != null) { Dialogue.AddParticipant(Zacks); } Dialogue.SetImportantDialogue(); data.SpokeToBluePosQuest = true; if (data.BlueWasPresent) { if (Zacks == null) { switch (data.BlueDialogueStep) { case 0: case 1: Dialogue.ShowDialogueWithContinue("*I'm so happy that we managed to find him...*"); Dialogue.ShowDialogueWithContinue("*I have to tell you, [nickname]... My initial intention when I moved here, was to look for him.*"); Dialogue.ShowDialogueWithContinue("*I intended to look for him by myself, but we were fortunate to bump into him during your travels.*"); Dialogue.ShowDialogueWithContinue("*But what worries me right now is his state current state...*"); Dialogue.ShowDialogueWithContinue("*I'll try my best to help him overcome the zombie instinct from trying to take him over again.*"); Dialogue.ShowDialogueWithContinue("*Sorry for speaking too much... It's just all too sudden...*"); Dialogue.ShowEndDialogueMessage("*Thank you, [nickname]. For helping me save Zacks.*", false); break; case 2: Dialogue.ShowDialogueWithContinue("*I'm so happy that we managed to find Zacks...*"); Dialogue.ShowDialogueWithContinue("*But the state we found him really shocked me. I didn't thought he would turn into a Zombie.*"); Dialogue.ShowDialogueWithContinue("*Still... I have to do my best to help him overcome his unending hunger issue.*"); Dialogue.ShowDialogueWithContinue("*I hope you be able to help Zacks too, [nickname].*"); Dialogue.ShowDialogueWithContinue("*So, can I count on you, [nickname]?*"); Dialogue.ShowEndDialogueMessage("*Sorry, you don't need to answer. Thank you for helping me so far.*", false); break; } } else { Dialogue.ShowDialogueWithContinue("*Zacks, how are you feeling?*"); Dialogue.ShowDialogueWithContinue("*Not so good... I can hardly move my left leg, and I feel an unending hunger.*", Zacks); Dialogue.ShowDialogueWithContinue("*Don't worry, at least you're back to us.*", Blue); Dialogue.ShowDialogueWithContinue("*Yes, but... What if I end up being a danger for everyone?*", Zacks); Dialogue.ShowDialogueWithContinue("*Then I will be there to stop you, even if I have to lock you at home.*", Blue); Dialogue.ShowDialogueWithContinue("*I like staying at home, anyways.*", Zacks); Dialogue.ShowDialogueWithContinue("*Hahaha... I missed your sense of humor.*", Blue); Dialogue.ShowDialogueWithContinue("*Welcome back, Zacks. I'll help you overcome those zombie instincts.*", Blue); Dialogue.ShowDialogueWithContinue("*Thank you... Blue..*", Zacks); if (data.BlueDialogueStep == 2) { Dialogue.ShowDialogueWithContinue("*I'm really glad that I asked you for help. Now I got Zacks back to my life.*", Blue); Dialogue.ShowEndDialogueMessage("*Thank you very much, [nickname].*", false); } else { Dialogue.ShowDialogueWithContinue("*[nickname], I have to tell you something...*"); Dialogue.ShowDialogueWithContinue("*I visitted your world, because I were looking for Zacks.*"); Dialogue.ShowDialogueWithContinue("*I thought I could find him on my own, but we managed to bump into him during your travels.*"); Dialogue.ShowDialogueWithContinue("*Don't worry much about that, I think not even the Terrarian expected this outcome on their travels.*", Zacks); Dialogue.ShowEndDialogueMessage("*That's true. Thank you, [nickname], for helping bring Zacks back to us.*", false, Blue); } } } else { if (Zacks == null) { Dialogue.ShowDialogueWithContinue("*Zacks!*"); Dialogue.ShowDialogueWithContinue("*Hello, Blue...*", Zacks); Dialogue.ShowDialogueWithContinue("*Zacks, what happened to you? How did you ended up like that?*", Blue); Dialogue.ShowDialogueWithContinue("*I think... I was betrayed... If it wasn't for that Terrarian and you, I would still be a brainless zombie.*", Zacks); Dialogue.ShowDialogueWithContinue("*Me? How did I managed to help?*", Blue); Dialogue.ShowDialogueWithContinue("*I caught your scent, on the hairpin you gave to the Terrarian.*", Zacks); Dialogue.ShowDialogueWithContinue("*I'm glad that I managed to help you, somehow...*", Blue); Dialogue.ShowDialogueWithContinue("*[nickname], Thank You for bringing him back to my life.*", Blue); if (data.BlueDialogueStep < 2) { Dialogue.ShowEndDialogueMessage("*I really wish I told you that I was looking for him sooner but... I really though... No.. It's not important...\n" + "Thank you.*", false); } else { Dialogue.ShowEndDialogueMessage("*I'm really happy for trusting you with looking for him...\n" + "Thank you, [nickname].*", false); } } else { Dialogue.ShowDialogueWithContinue("*You managed to find him!*"); Dialogue.ShowDialogueWithContinue("*I... Sorry... I shouldn't straight up say that even though you don't know what I'm talking about...*"); Dialogue.ShowDialogueWithContinue("*I should have told you earlier, that I was looking for that TerraGuardian who now is a zombie.*"); Dialogue.ShowDialogueWithContinue("*I don't know how you managed to save him, but I thank you for that.*"); Dialogue.ShowEndDialogueMessage("*Now, is there something else you need?*", false); } } QuestCompletedNotification(data); }