private void DryadAlertEmote(FrameEventData evt) { if (_dryad != null && evt.IsFirstFrame) { EmoteBubble.NewBubble(3, new WorldUIAnchor(_dryad), evt.Duration); } }
public override void AI() { Player player = Main.LocalPlayer; if (WitchQuest(player.GetModPlayer <CastledPlayer>(), 3, 3, false)) { if (NPC.AnyNPCs(NPCID.Stylist) && !NPC.AnyNPCs(ModContent.NPCType <NPCs.Witch.StylistWitch>())) { if (LineOfSight(player)) { npc.ai[0] = 0; npc.ai[1] = 300; npc.direction = player.position.X <= npc.position.X ? -1 : 1; if (reaction[1] < 1) { EmoteBubble.NewBubble(EmoteID.EmotionAlert, new WorldUIAnchor(npc), 60); reaction[1] = 1; reaction[0] = 300; } } } if ((!NPC.AnyNPCs(NPCID.Stylist) || NPC.AnyNPCs(ModContent.NPCType <NPCs.Witch.StylistWitch>()) || !LineOfSight(player)) && reaction[1] > 0) { if (reaction[0]-- < 1) { reaction[1] = 0; } } } }
private void OnChat(ServerChatEventArgs args) { TSPlayer player = TShock.Players[args.Who]; if (player == null) { return; } //Check if the provided text matches any of the defined regexes Regex regex = Regexes.Keys.FirstOrDefault(r => r.IsMatch(args.Text)); if (regex == null) { return; } Match match = regex.Match(args.Text); int ID = EmoteBubble.AssignNewID(); if (!String.IsNullOrEmpty(match.Groups["spoken"].Value)) { args.Handled = true; } NetMessage.SendData(91, -1, -1, NetworkText.Empty, ID, 1, args.Who, 600, Regexes[regex].EmoteID); }
// Token: 0x0600131A RID: 4890 RVA: 0x0041AC18 File Offset: 0x00418E18 private void DryadConfusedEmote(FrameEventData evt) { if (this._dryad != null && evt.IsFirstFrame) { EmoteBubble.NewBubble(87, new WorldUIAnchor(this._dryad), evt.Duration); } }
private void DryadAlertEmote(FrameEventData evt) { if (this._dryad == null || !evt.IsFirstFrame) { return; } EmoteBubble.NewBubble(3, new WorldUIAnchor((Entity)this._dryad), evt.Duration); }
private void DryadConfusedEmote(FrameEventData evt) { if (_dryad == null || !evt.IsFirstFrame) { return; } EmoteBubble.NewBubble(87, new WorldUIAnchor(_dryad), evt.Duration); }
public override void Click(UIMouseEvent evt) { base.Click(evt); if (Main.netMode == 0) { EmoteBubble.NewBubble(_emoteIndex, new WorldUIAnchor(Main.LocalPlayer), 360); EmoteBubble.CheckForNPCsToReactToEmoteBubble(_emoteIndex, Main.LocalPlayer); } else { NetMessage.SendData(120, -1, -1, null, Main.myPlayer, _emoteIndex); } IngameFancyUI.Close(); }
public override void Click(UIMouseEvent evt) { base.Click(evt); if (Main.netMode == 0) { EmoteBubble.NewBubble(this._emoteIndex, new WorldUIAnchor((Entity)Main.LocalPlayer), 360); EmoteBubble.CheckForNPCsToReactToEmoteBubble(this._emoteIndex, Main.LocalPlayer); } else { NetMessage.SendData(120, -1, -1, (NetworkText)null, Main.myPlayer, (float)this._emoteIndex, 0.0f, 0.0f, 0, 0, 0); } IngameFancyUI.Close(); }
public void ProcessOutgoingMessage(ChatMessage message) { int num = Main.rand.NextFromList <int>(37, 38, 36); if (Main.netMode == 0) { EmoteBubble.NewBubble(num, new WorldUIAnchor(Main.LocalPlayer), 360); EmoteBubble.CheckForNPCsToReactToEmoteBubble(num, Main.LocalPlayer); } else { NetMessage.SendData(120, -1, -1, null, Main.myPlayer, num); } message.Consume(); }
public static int AttachEmote(int anchorType, int anchorId, int emoteId, int lifeTime) { int ID = EmoteBubble.AssignNewID(); //int anchorType = 0; // 0 = npc, 1 = player, 2 = projectile //int anchorId = this.Index; //ushort meta1 = 0; //id of the above //byte lifeTime = 255; //int emoteId = EmoteID.WeatherRain; //int emote = 1; //TSPlayer.All.SendData(PacketTypes.EmoteBubble, "", emoteId, anchorType, meta1, lifeTime, emote, meta1); NetMessage.SendData(91, -1, -1, NetworkText.Empty, ID, anchorType, anchorId, lifeTime, emoteId); return(ID); }
public void TryTalkWithCD(TalkType talkType, int CD) { int talkInt = (int)talkType; if (TalkCDs[talkInt] > 0 || universalTalkCD > 0) { return; } TalkCounters[talkInt] = (TalkCounters[talkInt] + 1) % MaxThingsToSay[talkInt]; TalkCDs[talkInt] = CD; universalTalkCD = 0; if (Projectile.owner == Main.myPlayer && ModContent.GetInstance <SoulConfig>().DeviChatter) { if (!Main.player[Projectile.owner].dead && !Main.player[Projectile.owner].ghost) { EmoteBubble.MakeLocalPlayerEmote(EmoteID.EmotionLove); } SoundEngine.PlaySound(SoundID.LucyTheAxeTalk, Projectile.Center); string key = Enum.GetName(talkType); int actualSay = TalkCounters[talkInt] + 1; string text = Language.GetTextValue($"Mods.FargowiltasSouls.DeviChatter.{key}{actualSay}"); Vector2 pos = Vector2.Lerp(Main.MouseWorld, Projectile.Center, 0.5f); pos = Vector2.Lerp(pos, Main.player[Projectile.owner].Center, 0.5f); PopupText.NewText(new AdvancedPopupRequest() { Text = text, DurationInFrames = 420, Velocity = 7 * -Vector2.UnitY, Color = Color.HotPink * 1.15f }, pos); //FargoSoulsUtil.HeartDust( // Projectile.Center, // addedVel: 0.5f * new Vector2(7 * Projectile.direction, -7), // spreadModifier: 0.5f, // scaleModifier: 0.5f //); } }
public void ProcessOutgoingMessage(ChatMessage message) { int result = -1; if (int.TryParse(message.Text, out result)) { if (result < 0 || result >= 145) { return; } } else { result = -1; } if (result == -1) { foreach (LocalizedText key in this._byName.Keys) { if (message.Text == key.Value) { result = this._byName[key]; break; } } } if (result != -1) { if (Main.netMode == 0) { EmoteBubble.NewBubble(result, new WorldUIAnchor((Entity)Main.LocalPlayer), 360); EmoteBubble.CheckForNPCsToReactToEmoteBubble(result, Main.LocalPlayer); } else { NetMessage.SendData(120, -1, -1, (NetworkText)null, Main.myPlayer, (float)result, 0.0f, 0.0f, 0, 0, 0); } } message.Consume(); }
public virtual void InitUnit() { initialized = true; //currentheightcorrect = 0f; fallingcount = 0f; turnnum = 0; emoteturncount = 0; //steplayermask=LayerMask.GetMask() stepping = false; hunger = 0; cam = FindObjectOfType <Camera>(); camscript = cam.GetComponent <CameraManager>(); climbing = false; glownum = 0; rend = GetComponent <MeshRenderer>(); //maxhitpoints = hitpoints; hitpoints = maxhitpoints; falling = false; rotating = false; //ismonster = true; alive = true; moving = false; TargPos = transform.position; rb = GetComponent <Rigidbody>(); //boxcollider = GetComponent<BoxCollider>(); //GetComponent<MeshCollider>().enabled = false; inversemovetime = 1f / movetime; TargDir = transform.rotation; //thisturn = false; EmoteBubbleObj = Instantiate(EmoteBubbleObj, transform.position, Quaternion.identity); EmoteBubbleObj.transform.SetParent(transform, true); EmoteBubbleObj.transform.localPosition = Vector3.zero;//Vector3.up;//+Vector3.right; emotebubble = EmoteBubbleObj.GetComponent <EmoteBubble>(); horizontal = 0; vertical = 0; }
public override void AI() { Player player = Main.LocalPlayer; if (CastledWorld.pirateIndex == null || CastledWorld.pirateIndex.Length < 1) { CastledWorld.pirateIndex = new int[2]; for (int a = 0; a < CastledWorld.pirateIndex.Length; a++) { CastledWorld.pirateIndex[a] = 0; } } CastledWorld.pirateIndex[0] += Main.dayRate; if (player.HeldItem.type == ItemID.HolyWater) { if (LineOfSight(player)) { npc.ai[0] = 0; npc.ai[1] = 300; npc.direction = player.position.X <= npc.position.X ? -1 : 1; if (reaction[1] < 1) { EmoteBubble.NewBubble(EmoteID.EmotionAlert, new WorldUIAnchor(npc), 60); reaction[1] = 1; reaction[0] = 300; } if (reaction[1] == 2 && Main.rand.NextBool(90)) { Dust.NewDust(npc.position, npc.width, npc.height, 172, 0, 4); } } } if ((player.HeldItem.type != ItemID.HolyWater || !LineOfSight(player)) && reaction[1] > 0) { if (reaction[0]-- < 1) { reaction[1] = 0; } } if (EmptyQuests()) { player.GetModPlayer <CastledPlayer>().witchQuest = new int[4]; for (int a = 0; a < player.GetModPlayer <CastledPlayer>().witchQuest.Length; a++) { player.GetModPlayer <CastledPlayer>().witchQuest[a] = 0; } } bool EmptyQuests() => player.GetModPlayer <CastledPlayer>().witchQuest.Length < 1; if (atckDelay-- < 0) { atckDelay = 0; } if (CastledWorld.pirateIndex[0] > Main.dayLength) { CastledWorld.pirateIndex[1]++; CastledWorld.pirateIndex[0] = 0; } if (CastledWorld.pirateIndex[1] > 5) { CastledWorld.pirateIndex[1] = 0; } }