示例#1
0
        public override void SpawnNPC(int type, int tileX, int tileY)
        {
            //int a = base.SpawnNPC(type, tileX, tileY);
            NPC npc = Main.npc[type];

            if (Main.rand.Next(74) == 0)
            {
                Light.ApplyLuxBoosts(ref npc);
                //npc.DisplayName.set("Lux "+npc.DisplayName.Get());
                //npc.AddBuff(BuffType<Lux>(), 600);
                for (int i = 0; i < Main.player.Length; i++)
                {
                    Main.player[i].chatOverhead.NewMessage("!", 30);
                }
                //Main.NewText("!");
            }
            else if (Main.rand.Next(99) == 0)
            {
                Light.ApplyShadeBoosts(ref npc);
                //npc.DisplayName.set("Umbra "+npc.DisplayName.Get());
                //npc.AddBuff(BuffType<Umbra>(), 600);
                //npc.music = 0;
                for (int i = 0; i < Main.player.Length; i++)
                {
                    Main.player[i].chatOverhead.NewMessage("!!!", 30);
                }
                //Main.NewText("!!!");
            }
        }        //*/
示例#2
0
        public override void Action(CommandCaller player, string input, string[] args)
        {
            if (!int.TryParse(args[0], out int type))
            {
                Type idtype = typeof(NPCID);
                if (int.TryParse(idtype.GetField(args[0]).GetRawConstantValue().ToString(), out type))
                {
                    Main.NewText("You're using it wrong, " + player.Player.name + ", it's /umbra NPCID, NPCID can either be the numeric ID or the field name in the NPCID class");
                }
            }
            int spawnedNPC = NPC.NewNPC((int)Main.MouseWorld.X, (int)Main.MouseWorld.Y, type);

            //Main.npc[spawnedNPC].AddBuff(BuffType<Umbra>(), 600);
            if (ModLoader.GetMod("DevHelp") == null)
            {
                Main.npc[spawnedNPC].dontTakeDamage = true;
            }
            Light.ApplyShadeBoosts(ref Main.npc[spawnedNPC]);
        }