Ejemplo n.º 1
0
    public override void Initialize()
    {
        //获得场景物体引用
        movementComponent = GetComponent <MovementPlayer>();

        //初始化技能类
        fireBallSpell = new FireBallSpell();
        fireBallSpell.Initialize();

        meteoriteSpell = new MeteoriteSpell();
        meteoriteSpell.Initialize();

        protectiveFireBallSpell = new ProtectiveFireBallSpell();
        protectiveFireBallSpell.Initialize();

        rocketPackSpell = new RocketPackSpell();
        rocketPackSpell.Initialize();

        fireThunderSpell = new FireThunderSpell();
        fireThunderSpell.Initialize();

        //辅助技能直接enable
        remoteControlBombSpell = new RemoteControlBombSpell();
        remoteControlBombSpell.Initialize();
        remoteControlBombSpell.Enable();

        lavaSpell = new LavaSpell();
        lavaSpell.Initialize();

        meteorShowerSpell = new MeteorShowerSpell();
        meteorShowerSpell.Initialize();

        selfExplosionSpell = new SelfExplosionSpell();
        selfExplosionSpell.Initialize();
    }
Ejemplo n.º 2
0
    // Use this for initialization
    public override void Start()
    {
        base.Start();
        interruptableByNormalAttack = false;

        TrajectoryDetector.OnTrigger += TrajectoryGestureTriggered;
        HandUpDetector.OnTrigger     += HandUpGestureTriggered;
        GrabDetector.OnGrab          += GrabGestureTriggered;

        skillAntiGravity  = new AntiGravity();
        skillGrabbing     = new Grabbing();
        skillSpike        = new EarthSpikes();
        skillBeam         = new LightBeam();
        skillFireBall     = new FireBallSpell();
        skillLightning    = new LightningStrike();
        skillSummonHelper = new SummonHelper();
        skillHeal         = new Heal();
        skillSpeedUp      = new SpeedUp();
    }
Ejemplo n.º 3
0
        public virtual ISpell CreateSpell(LivingEntity caller)
        {
            ISpell spell = null;

            switch (this.Kind)
            {
            case SpellKind.FireBall:
                spell = new FireBallSpell(caller);
                break;

            case SpellKind.PoisonBall:
                spell = new PoisonBallSpell(caller);
                break;

            case SpellKind.IceBall:
                spell = new IceBallSpell(caller);
                break;

            case SpellKind.Skeleton:
                spell = new SkeletonSpell(caller, Roguelike.Generators.GenerationInfo.Difficulty);
                break;

            case SpellKind.Transform:
                spell = new TransformSpell(caller);
                break;

            case SpellKind.ManaShield:
                spell = new ManaShieldSpell(caller);
                break;

            case SpellKind.Rage:
                spell = new RageSpell(caller);
                break;

            case SpellKind.Weaken:
                spell = new WeakenSpell(caller);
                break;

            case SpellKind.Inaccuracy:
                spell = new InaccuracySpell(caller);
                break;

            case SpellKind.IronSkin:
                spell = new IronSkinSpell(caller);
                break;

            case SpellKind.Teleport:
                spell = new TeleportSpell(caller);
                break;

            case SpellKind.Portal:
                spell = new Portal(caller);
                break;

            case SpellKind.ResistAll:
                spell = new ResistAllSpell(caller);
                break;

            default:
                break;
                throw new Exception("CreateSpell ???" + Kind);
            }
            if (spell is IProjectileSpell proj)
            {
                proj.Range += spell.CurrentLevel - 1;
            }
            return(spell);
        }