Ejemplo n.º 1
0
        public override void DoubleClick(UIMouseEvent evt)
        {
            var lp = LocalPlayer.GetModPlayer <MP>();
            var pj = new Terraria.Projectile();

            foreach (var _ in TUIL.cl)
            {
                for (int id = 1; id < Terraria.ModLoader.ProjectileLoader.ProjectileCount; id++)
                {
                    if (_.chosen && _.pl.All(pp => pp(pj)))
                    {
                        if ("Melee" == _.name)
                        {
                            lp.melee = true;
                        }
                        lp.idl.Add(pj.type);
                    }
                    pj.SetDefaults(id);
                }
            }
        }
Ejemplo n.º 2
0
        public void ProjectileDefaults_AbstractProjectile_EventTriggered()
        {
            var terrariaProjectile = new Terraria.Projectile();

            var events = Mock.Of <IEventManager>();
            var log    = Mock.Of <ILogger>();

            using var projectileService = new OrionProjectileService(events, log);

            Mock.Get(events)
            .Setup(em => em.Raise(
                       It.Is <ProjectileDefaultsEvent>(
                           evt => ((OrionProjectile)evt.Projectile).Wrapped == terrariaProjectile &&
                           evt.Id == ProjectileId.CrystalBullet),
                       log));

            terrariaProjectile.SetDefaults((int)ProjectileId.CrystalBullet);

            Assert.Equal(ProjectileId.CrystalBullet, (ProjectileId)terrariaProjectile.type);

            Mock.Get(events).VerifyAll();
        }