Beispiel #1
0
        private static Entity MultitossWeapon()
        {
            EntityTemplate basic = Assets.GetTemplate(Tables.basicTossingWeapons.Random());
            Entity         relic = new Entity(basic);

            GameObject      fxPrefab = Assets.TossFXPrefab;
            NonActorCommand nac      = new MultitossCommand(null, relic, 3);
            Talent          talent   = new Talent
            {
                OnCast = new[] { nac }
            };

            if (relic.TryGetComponent(out Evocable evoc))
            {
                evoc.AddTalent(talent);
            }
            else
            {
                Evocable newEvoc = new Evocable(talent);
                newEvoc.AddTalent(talent);
                relic.AddComponent(newEvoc);
            }

            return(relic);
        }
Beispiel #2
0
        private static Entity ExplosiveMagicWeapon()
        {
            GameObject fxPrefab = Assets.Prefabs[Tables.explosionFXIDs.Random()];
            AudioClip  sfx      = Assets.Audio["SFX_Explosion"];

            NonActorCommand nac;
            ExplodeCommand  expl = new ExplodeCommand(null)
            {
                Prefab  = fxPrefab,
                Sound   = sfx,
                Damages = new Damage[] {
                    new Damage()
                    {
                        Min  = 7,
                        Max  = 14,
                        Type = DamageType.Piercing
                    }
                }
            };

            int r = Random.Range(0, 2);

            switch (r)
            {
            default:
            case 0:
                expl.Pattern = ExplosionPattern.Point;
                nac          = new PointEffectCommand(null, expl);
                break;

            case 1:
                expl.Pattern = ExplosionPattern.Line;
                nac          = new LineEffectCommand(null, expl);
                break;
            }

            Talent talent = new Talent
            {
                OnCast = new[] { nac }
            };

            EntityTemplate basic = Assets.GetTemplate(Tables.basicMagicWeapons.Random());
            Entity         relic = new Entity(basic);

            if (relic.TryGetComponent(out Evocable evoc))
            {
                evoc.AddTalent(talent);
            }
            else
            {
                Evocable newEvoc = new Evocable(talent);
                newEvoc.AddTalent(talent);
                relic.AddComponent(newEvoc);
            }

            return(relic);
        }