public override string TalkMessage(Player player, TerraGuardian guardian) { List <string> Mes = new List <string>(); Mes.Add("*[name] showed you a rare insect he found, he seems very happy about that.*"); Mes.Add("*[name] is asking you when is going to happen another party.*"); Mes.Add("*[name] seems to want a new toy, but what could I give him?*"); Mes.Add("*[name] wants to explore the dungeon sometime.*"); if (NPC.AnyNPCs(Terraria.ID.NPCID.Merchant)) { Mes.Add("*[name] is asing me if [nn:" + Terraria.ID.NPCID.Merchant + "] has put his trash can outside.*"); } if (!PlayerMod.PlayerHasGuardianSummoned(player, 0)) { Mes.Add("*[name] seems to want to go on an adventure with you.*"); } if (PlayerMod.PlayerHasGuardianSummoned(player, 0)) { Mes.Add("*[name] is enjoying travelling with me.*"); Mes.Add("*[name] seems to killing insects with gasoline, I wonder where he acquired that.*"); if (guardian.Wet || guardian.HasBuff(Terraria.ID.BuffID.Wet)) { Mes.Add("*[name] is soaked and cold.*"); } } if (PlayerMod.PlayerHasGuardianSummoned(player, 1)) { Mes.Add("*[name] looks surprised at [gn:1], and suddenly forgets what he was going to talk about.*"); } if (PlayerMod.PlayerHasGuardianSummoned(player, 2)) { Mes.Add("*[name] is asking if you could let him play with [gn:2].*"); } return(Mes[Main.rand.Next(Mes.Count)]); }
public override void ModifyDrawing(TerraGuardian tg, GuardianSpecialAttackData d) { CaptainStenchBase.CaptainStenchData data = (CaptainStenchBase.CaptainStenchData)tg.Data; switch (data.SwordID) { case CaptainStenchBase.RubyFalchion: { if (d.Step >= 4) { int WhipFrame = d.Step - 4; Texture2D texture = tg.GetExtraTexture(CaptainStenchBase.RubyGPTextureID); if (WhipFrame >= 0 && WhipFrame < 6) { Vector2 WhipPos = tg.CenterPosition - Main.screenPosition; WhipPos.X += 40 * tg.Direction; GuardianDrawData gdd = new GuardianDrawData(GuardianDrawData.TextureType.TGExtra, texture, WhipPos, new Rectangle(160 * WhipFrame, 0, 160, 160), Color.White, 0f, new Vector2(80, 80), tg.Scale, (tg.LookingLeft ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); TerraGuardian.DrawFront.Add(gdd); } if (tg.HasBuff(Terraria.ModLoader.ModContent.BuffType <Buffs.DrainingHealth>())) { int SiphonFrame = d.Step - 5; if (SiphonFrame >= 0 && SiphonFrame < 7) { GuardianDrawData gdd = new GuardianDrawData(GuardianDrawData.TextureType.TGExtra, texture, tg.Position - Main.screenPosition, new Rectangle(160 * SiphonFrame, 160, 160, 160), Color.White, 0f, new Vector2(80, 160), tg.Scale, (tg.LookingLeft ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); TerraGuardian.DrawFront.Add(gdd); } } } } break; case CaptainStenchBase.DiamondFalchion: { int FlashFrame = (int)(((d.Step - 4) * AnimationTime + d.Time) * (1f / AnimationTime) * 0.5f); if (FlashFrame >= 0 && FlashFrame < 8) { Texture2D texture = tg.GetExtraTexture(CaptainStenchBase.DiamondGPTextureID); GuardianDrawData gdd = new GuardianDrawData(GuardianDrawData.TextureType.TGExtra, texture, tg.CenterPosition - Main.screenPosition, new Rectangle(200 * FlashFrame, 0, 200, 200), Color.White, 0f, new Vector2(100, 100), tg.Scale, (tg.LookingLeft ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); TerraGuardian.DrawFront.Add(gdd); FlashFrame++; gdd = new GuardianDrawData(GuardianDrawData.TextureType.TGExtra, texture, tg.CenterPosition - Main.screenPosition, new Rectangle(200 * FlashFrame, 200, 200, 200), Color.White, 0f, new Vector2(100, 100), tg.Scale, (tg.LookingLeft ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); TerraGuardian.DrawFront.Add(gdd); } } break; } }
public override string NormalMessage(Player player, TerraGuardian guardian) { List <string> Mes = new List <string>(); Mes.Add("*I'm loving my time here.*"); Mes.Add("*(singing) Lalala...*"); Mes.Add("*Hello [nickname], want something?*"); Mes.Add("*Are you cooking something? I want to see your cooking secrets, teehee.*"); Mes.Add("*Happiness is contagious, am I right?*"); if (FlufflesBase.IsHauntedByFluffles(player)) { Mes.Add("*Aahh!! There's a ghost on your back!!*"); } if (!guardian.HasBuff(Terraria.ID.BuffID.WellFed)) { Mes.Add("(Growl) *Oh, my stomach is complaining... Is " + (Main.dayTime ? "lunch" : "dinner") + " ready?*"); Mes.Add("*I hate being hungry... I want to eat something...*"); Mes.Add("*Ow... I think I should be cooking something to eat.*"); } if (guardian.IsUsingToilet) { Mes.Clear(); Mes.Add("*I'm quite busy doing the number 2 here... Go away, please.*"); Mes.Add("*I really didn't wanted you to see me like this.*"); Mes.Add("*I can't concentrate with you staring at me.*"); } else if (Main.eclipse) { Mes.Add("*I'm sorry, but I really feel like locking myself inside my house now.*"); Mes.Add("*Do you think I'll be safe if I lock myself in the toilet?*"); Mes.Add("*Please, get those horrible creatures away!*"); } else if (Main.dayTime) { if (!Main.raining) { Mes.Add("*What a beautiful day.*"); Mes.Add("*I like seeing butterflies flying and critters around.*"); } else { Mes.Add("*Oh nice... It's raining... Well.... I'll take the day off.*"); Mes.Add("*Acho~! Sorry... I'm alergic to this weather.*"); Mes.Add("*I'm getting a bit drowzy...*"); } } else { Mes.Add("*What a silent night.*"); Mes.Add("*I think I saw something moving in the dark.*"); Mes.Add("*It's too quiet, and that doesn't makes me feel okay.*"); } if (guardian.IsPlayerRoomMate(player)) { Mes.Add("*I love having you as my room mate. Your help when making the morning set will be very helpful.*"); Mes.Add("*It's nice sharing the room with you.*"); } // if (NpcMod.HasGuardianNPC(Rococo)) { Mes.Add("*[gn:" + Rococo + "] helps me with testing food. He seems to enjoy that.*"); Mes.Add("*Sometimes [gn:" + Rococo + "] brings trash, wanting me to add them to the food. I keep denying but he keeps bringing them.*"); } if (NpcMod.HasGuardianNPC(Blue)) { Mes.Add("*[gn:" + Blue + "] has a really cool hair.*"); } if (NpcMod.HasGuardianNPC(Bree)) { Mes.Add("*I were learning how to cook from [gn:" + Bree + "].*"); Mes.Add("*[gn:" + Bree + "] isn't that much grumpy when you talk about something she likes.*"); } if (NpcMod.HasGuardianNPC(Glenn)) { Mes.Add("*Sometimes I play with [gn:" + Glenn + "]. I like that there's someone of my age around.*"); Mes.Add("*There are some times where I don't like playing a game with [gn:" + Glenn + "], he can't accept when I win.*"); } if (NpcMod.HasGuardianNPC(Brutus)) { Mes.Add("*[gn:" + Brutus + "] told me not to wander on the outside alone... He said that I should call him when I'm going to do so. But I'm already a grown girl, I can take care of myself!*"); Mes.Add("*I offered [gn:" + Brutus + "] some food earlier, It looked like he liked It.*"); } if (NpcMod.HasGuardianNPC(Fluffles)) { Mes.Add("*A lot of people seems to be scared of [gn:" + Fluffles + "], but I'm not.*"); } if (NpcMod.HasGuardianNPC(Liebre)) { Mes.Add("*I saw [gn:" + Liebre + "] watching me the other day. Am I going to die?*"); Mes.Add("*It's so scary! Sometimes I'm playing around my house, I see [gn:" + Liebre + "] watching me. Is my time coming? I don't want to die!*"); } if (NpcMod.HasGuardianNPC(Vladimir)) { Mes.Add("*Sometimes, I ask [gn:" + Vladimir + "] to help me test food. He has an accurate taste for seasoning, he impresses me.*"); Mes.Add("*I'm curious to meet [gn:" + Vladimir + "]'s brother. Is he as nice as him?*"); } if (NpcMod.HasGuardianNPC(Mabel)) { Mes.Add("*Why people keep staring at [gn:" + Mabel + "]? It's so weird.*"); Mes.Add("*I asked [gn:" + Mabel + "] if she wanted to test the newest food I cooked, but she said she can't, or else she would gain weight.*"); } if (NpcMod.HasGuardianNPC(Minerva)) { Mes.Add("*I love hanging around with [gn:" + Minerva + "], we keep testing each other's meal, to see if we make the best ones.*"); Mes.Add("*I actually don't exagerate when testing my meals, so you don't need to worry about me ending up like [gn:" + Minerva + "].*"); } if (NpcMod.HasGuardianNPC(Zacks)) { Mes.Add("*The other day, [gn:" + Zacks + "] was at my house and pulled my blanked! I woke up and screamed so loud that he run away.*"); Mes.Add("*Sometimes, during the night, I see [gn:" + Zacks + "] staring through the window.*"); Mes.Add("*I fear leaving my house at night, because [gn:" + Zacks + "] may be out there.*"); } if (NpcMod.HasGuardianNPC(Miguel)) { Mes.Add("*[gn:" + Miguel + "] gave me some tips of things I could use as alternative on my meals.*"); } if (NpcMod.HasGuardianNPC(Green)) { Mes.Add("*[gn:" + Green + "] is really scary! He always look at us with a menacing face, and looks like he can swallow me whole.*"); Mes.Add("*I don't like getting sick or injured, because that means I'll have to visit [gn:" + Green + "].*"); } // if (guardian.IsSleeping) { Mes.Clear(); Mes.Add("*Nom nom nom nom nom nom...* (She seems to be dreaming about eating lots of food)"); Mes.Add("*Zzzzz.... (Snif snif) Hmmm....* (She smelled something good.)"); Mes.Add("*Zzzz... Zzzzzz..... More food.... Seasoning.... Eat.... Zzzzz...*"); } if (Main.bloodMoon) { Mes.Clear(); Mes.Add("*What now?!*"); Mes.Add("*Don't you have someone else to bother?*"); Mes.Add("*Enough!*"); Mes.Add("*No! I wont cook for you!*"); } return(Mes[Main.rand.Next(Mes.Count)]); }
public override void Update(TerraGuardian guardian) { if (guardian.ItemAnimationTime <= 0 && !guardian.IsAttackingSomething) { for (int i = 0; i < 50; i++) { if (guardian.Inventory[i].buffType > 0 && !Main.vanityPet[guardian.Inventory[i].buffType] && !Main.lightPet[guardian.Inventory[i].buffType] && !Main.projPet[guardian.Inventory[i].buffType] && !guardian.Inventory[i].summon && !guardian.Inventory[i].DD2Summon && !guardian.Inventory[i].sentry && !guardian.HasBuff(guardian.Inventory[i].buffType)) { guardian.SelectedItem = i; guardian.Action = true; return; } } InUse = false; } }
public override void Update(TerraGuardian guardian) { bool CanPickupPlayer = guardian.Base.MountUnlockLevel != 255 && guardian.Base.Size >= GuardianBase.GuardianSize.Large && !guardian.PlayerMounted && !guardian.SittingOnPlayerMount; AvoidItemUsage = true; bool HoldingPlayer = false; FocusCameraOnGuardian = false; /*if (Target.dead) * { * InUse = false; * return; * }*/ switch (Step) { case 0: if (guardian.furniturex > -1) { guardian.LeaveFurniture(); } if (TryReachingPlayer(guardian, Target)) { ChangeStep(); } break; case 1: if (!CanPickupPlayer) { ChangeStep(); } else { FocusCameraOnGuardian = true; if (Time < 8) { int AnimFrame = Time / 4; if (guardian.Ducking) { SetPlayerOnHandPosition(guardian, Target, guardian.Base.DuckingSwingFrames[2 - AnimFrame], HeldHand.Right); } else { SetPlayerOnHandPosition(guardian, Target, guardian.Base.ItemUseFrames[3 - AnimFrame], HeldHand.Right); } } else { HoldingPlayer = true; ChangeStep(); } } break; case 2: { IgnoreCombat = true; AvoidItemUsage = false; EffectOnlyMirror = true; if (!guardian.HasMagicMirror) { ChangeStep(4); } if (guardian.ItemAnimationTime <= 0) { guardian.UseMagicMirror(); if (Time >= 10 * 60) { ChangeStep(4); Main.NewText("For some reason, " + guardian.Name + " got Itself confused when using the magic mirror."); } } if (guardian.MagicMirrorTrigger) { ChangeStep(); Player player = Target; if (guardian.HasBuff(Terraria.ID.BuffID.Horrified)) { string Mes; switch (Main.rand.Next(6)) { default: Mes = " is asking if you are nuts."; break; case 0: Mes = " is asking what you have on your head."; break; case 1: Mes = " says that this is not the right time and place to do that."; break; case 2: Mes = " questions itself \"WHAT?!\" a few moments before attempting to teleport."; break; case 3: Mes = " asks if there is something wrong with your head."; break; case 4: Mes = " said that It's not the wisest thing to do right now."; break; } Main.NewText("*" + guardian.Name + Mes + "*"); } else { player.Spawn(); guardian.Spawn(); PlayerMod pm = player.GetModPlayer <PlayerMod>(); /*guardian.Spawn(); * guardian.Position.X = player.SpawnX * 16; * guardian.Position.Y = player.SpawnY * 16; * player.position.X = player.SpawnX * 16 + 8 - player.width * 0.5f; * player.position.Y = player.SpawnY * 16 - player.height;*/ Vector2 PlayerBottom = new Vector2(player.position.X + player.width * 0.5f, player.position.Y + player.height); guardian.Position = PlayerBottom; guardian.FallStart = (int)guardian.Position.Y / 16; foreach (TerraGuardian mg in pm.GetAllGuardianFollowers) { if (mg.Active && (mg.PlayerMounted || mg.PlayerControl)) { mg.Spawn(); mg.Position = PlayerBottom; mg.FallStart = (int)mg.Position.Y / 16; } } } } HoldingPlayer = true; } break; case 3: { if (guardian.ItemAnimationTime == 0) { ChangeStep(); } HoldingPlayer = true; } break; case 4: { if (!CanPickupPlayer) { ChangeStep(); } else { FocusCameraOnGuardian = true; if (Time < 8) { if (guardian.Ducking) { int AnimFrame = 2 - Time / 4; SetPlayerOnHandPosition(guardian, Target, guardian.Base.DuckingSwingFrames[2 - AnimFrame], HeldHand.Right); } else { int AnimFrame = 2 - Time / 4; SetPlayerOnHandPosition(guardian, Target, guardian.Base.ItemUseFrames[3 - AnimFrame], HeldHand.Right); } } else { ChangeStep(); } } } break; case 5: if (CanPickupPlayer) { SetPlayerPositionOnGuardianCenter(guardian, Target); } InUse = false; break; } if (HoldingPlayer) { if (CanPickupPlayer) { FocusCameraOnGuardian = true; if (guardian.Ducking) { SetPlayerOnHandPosition(guardian, Target, guardian.Base.DuckingSwingFrames[1], HeldHand.Right); } else { SetPlayerOnHandPosition(guardian, Target, guardian.Base.ItemUseFrames[2], HeldHand.Right); } Target.velocity.Y = -Player.defaultGravity; guardian.ProtectingPlayerFromHarm = true; } else if (!guardian.PlayerMounted && !guardian.SittingOnPlayerMount) { /*Vector2 HandPosition = GetHandPosition(guardian, guardian.Base.ItemUseFrames[2], HeldHand.Right); * float HorizontalPosChange = Target.Center.X - HandPosition.X; * if (!guardian.PlayerMounted && !guardian.SittingOnPlayerMount && Math.Abs(HorizontalPosChange) >= Target.width * 0.5f) * { * //guardian.Position.X += HorizontalPosChange; * if (HorizontalPosChange < 0) * { * guardian.MoveLeft = true; * } * else * { * guardian.MoveRight = true; * } * }*/ } } }
public override string NormalMessage(Player player, TerraGuardian guardian) { bool MerchantInTheWorld = NPC.AnyNPCs(Terraria.ID.NPCID.Merchant), SteampunkerInTheWorld = NPC.AnyNPCs(Terraria.ID.NPCID.Steampunker); List <string> Mes = new List <string>(); if (!Main.bloodMoon && !Main.eclipse) { Mes.Add("*[name] is happy for seeing you.*"); Mes.Add("*[name] asks if you brought him something to eat.*"); Mes.Add("*[name] is asking if you want to play with him.*"); Mes.Add("*[name] wants you to check some of his toys.*"); Mes.Add("*[name] seems very glad to see you safe.*"); if (guardian.OwnerPos == -1) { Mes.Add("*[name] is asking you if you came to ask him to go on an adventure.*"); } if (guardian.HasBuff(Terraria.ID.BuffID.WellFed)) { Mes.Add("*[name] thanks you for the food.*"); Mes.Add("*[name] seems to be relaxing after eating something.*"); } else { Mes.Add("*You can hear [name]'s stomach growl.*"); Mes.Add("*[name] seems to be a bit hungry.*"); } } if (MainMod.IsPopularityContestRunning) { Mes.Add("*[name] is telling you that the TerraGuardians Popularity Contest is running right now, and asks if you're going to vote.*"); Mes.Add("*[name] says that he can take you to the voting of the popularity contest, and that all you need to do is speak to him about it.*"); } if (Main.dayTime) { if (!Main.eclipse) { Mes.Add("*[name] asks you what's up.*"); Mes.Add("*[name] is telling that is liking the weather.*"); } else { Mes.Add("*[name] seems to be watching some classic horror movie on the tv... No, wait, that's a window.*"); Mes.Add("*[name] is trying to hide behind you, he seems scared of the monsters.*"); } } else { if (!Main.bloodMoon) { if (MerchantInTheWorld) { Mes.Add("*As soon as [name] started talking, you hastily asked him to stop, because of the bad trash breath that comes from his mouth.*"); } Mes.Add("*[name] is sleeping while awake.*"); Mes.Add("*[name] is trying hard to keep It's eyes opened.*"); Mes.Add("*[name] seems sleepy.*"); } else { Mes.Add("*[name] looks scared.*"); Mes.Add("*[name] is trembling in terror..*"); Mes.Add("*[name] asks if his house is safe.*"); } } if (Terraria.GameContent.Events.BirthdayParty.PartyIsUp) { Mes.Add("*[name] seems to be enjoying the party.*"); } if (SteampunkerInTheWorld) { Mes.Add("*[name] is talking something about a jetpack joyride?*"); } if (NpcMod.HasGuardianNPC(1)) { Mes.Add("*[name] seems to be crying, and with a purple left eye, I guess his dialogue with [gn:1] went wrong.*"); Mes.Add("*[name] seems to be crying, and with his right cheek having a huge red paw marking, I wonder what he were talking about with [gn:1].*"); } if (NpcMod.HasGuardianNPC(3)) { Mes.Add("*[name] seems to have gotten kicked in his behind. Maybe he annoyed [gn:3]?*"); } if (PlayerMod.PlayerHasGuardianSummoned(player, 2) && PlayerMod.PlayerHasGuardian(player, 1)) { Mes.Add("*[gn:2] is telling [name] that he's lucky that [gn:1] doesn't plays her terrible games with him. But [name] insists that he wanted to play.*"); } if (PlayerMod.PlayerHasGuardianSummoned(player, 1)) { Mes.Add("*[name] asked [gn:1] why she doesn't plays with him, she told him that she can't even bear seeing him.*"); } if (PlayerMod.PlayerHasGuardianSummoned(player, 3) && PlayerMod.PlayerHasGuardian(player, 1)) { Mes.Add("*[name] asked [gn:3] why he doesn't plays with him, he told him that It's because he makes [gn:1] upset.*"); } if (NpcMod.HasGuardianNPC(5)) { Mes.Add("*[name] says that loves playing with [gn:5], but wonders why he always find him on hide and seek.*"); Mes.Add("*[name] says that bringing [gn:5] made the town very livelly.*"); } if (NpcMod.HasGuardianNPC(8)) { Mes.Add("*[name] said that [gn:8] looks familiar, have they met before?*"); } if (NpcMod.HasGuardianNPC(Vladimir)) { Mes.Add("*[name] hugs you. It feels a bit weird. He never hugged you without a reason.*"); } if (NpcMod.HasGuardianNPC(Fluffles)) { Mes.Add("*[name] says that sometimes he feels weird when [gn:" + Fluffles + "] stares at him for too long.*"); Mes.Add("*[name] is asking you if you know why [gn:" + Fluffles + "] looks at him, with her paw on the chin.*"); if (NpcMod.HasGuardianNPC(Alex)) { Mes.Add("*[name] says that playing with [gn:" + Alex + "] and [gn:" + Fluffles + "] has been one of the most enjoyable things he has done, and asks you to join too.*"); } } if (NpcMod.HasGuardianNPC(Glenn)) { Mes.Add("*[name] is telling you that [gn:" + Glenn + "] is his newest friend.*"); Mes.Add("*[name] says that loves playing with [gn:" + Glenn + "].*"); } if (NpcMod.HasGuardianNPC(Cinnamon)) { Mes.Add("*[name] says that after meeting [gn:" + Cinnamon + "], he has been eating several tasty foods.*"); Mes.Add("*[name] asks what is wrong with the seasonings he brings to [gn:" + Cinnamon + "].*"); } if (NpcMod.HasGuardianNPC(Luna)) { Mes.Add("*[name] is really happy for having [gn:" + Luna + "] around. He really seems to like her.*"); Mes.Add("*[name] seems to be expecting [gn:" + Luna + "]'s visit.*"); } if (guardian.IsUsingToilet) { Mes.Add("*[name] is telling me to plug my nose.*"); Mes.Add("*[name] is asking if there is no other moment to chat.*"); } if (guardian.IsPlayerRoomMate(player)) { Mes.Add("*[name] is very happy for having you as his room mate.*"); Mes.Add("*[name] says that no longer fear sleeping at night, since you shared your room with him.*"); } if (guardian.KnockedOut) { Mes.Clear(); if (!guardian.KnockedOutCold) { Mes.Add("*[name] says that will still try protecting you.*"); Mes.Add("*[name] is asking you to stay by his side for a while.*"); Mes.Add("(He's trying to endure the pain, you can see a few tears rolling from his eyes.)"); } else { Mes.Add("(He whited out.)"); Mes.Add("(He seems to be having pain while whited out.)"); } } else if (guardian.IsSleeping) { Mes.Clear(); Mes.Add("(He must be dreaming about playing with someone.)"); Mes.Add("(You got startled when he looked at your direction and smiled.)"); Mes.Add("(He seems to be sleeping fine.)"); } if (FlufflesBase.IsHauntedByFluffles(player) && Main.rand.NextDouble() < 0.75) { Mes.Clear(); Mes.Add("*[name] seems about scared of the ghost on your shoulders.*"); } return(Mes[Main.rand.Next(Mes.Count)]); }
public override bool GuardianCanUseItem(TerraGuardian guardian) { return(!guardian.HasBuff(ModContent.BuffType <Buffs.FirstAidCooldown>()) && guardian.Data.Injury > 0); }