コード例 #1
0
 public static Skill getMakeBattlePet()
 {
     if (makeBattlePet == null)
     {
         makeBattlePet                    = new Skill();
         makeBattlePet.name               = "Battle\nBot";
         makeBattlePet.icon               = Resources.Load <Sprite>("SpellVisuals/TECH/ROBOT PET/robot pet");
         makeBattlePet.description        = "A robot pet that seeks your love by acting as a tank for your party. Lasts 5 turns";
         makeBattlePet.manaCost           = user => 3;
         makeBattlePet.targetType         = Skill.TargetType.NONE;
         makeBattlePet.tileRestriction    = Skill.TargetTileRestriction.EMPTY;
         makeBattlePet.cooldown           = 5;
         makeBattlePet.range              = 2;
         makeBattlePet.OnTilePostEffects += (user, tile, args) =>
         {
             GameObject go = (GameObject)GameObject.Instantiate((GameObject)Resources.Load("basemodel"), tile.transform.position, user.transform.rotation);
             Unit       u  = go.AddComponent <Unit>();
             u.dontPlace = true;
             tile.SetUnit(u);
             u.faction       = user.faction;
             u.aiControlled  = true;
             u.baseMoveRange = 2;
             u.maxMP         = 10;
             u.maxHP         = 10;
             u.baseArmor     = 0.2f;
             u.AddSkill(SkillFactory.GetShiv());
             u.AddSkill(SkillFactory.GetSnipe());
             u.AddEffect(EffectFactory.getDoomEffect(), 5);
         };
         makeBattlePet.GenerateTasks = (user, tile, args) =>
         {
             GameManager.instance.tasks.Add(new Task_Trigger_Animation(user, "Punch"));
             GameManager.instance.tasks.Add(new Task_Wait(0.3f));
             GameManager.instance.tasks.Add(new Task_PlaySound(Resources.Load <AudioClip>("SE/Flash3")));
             GameManager.instance.tasks.Add(new Task_Fire_Projectile(user.transform.position + Vector3.up, tile.transform.position + Vector3.up, (GameObject)Resources.Load("SpellVisuals/TECH/ROBOT PET/battlebot projectile prefab"), 3));
             makeBattlePet.EnqueueExecuteTask(user, tile, args);
         };
     }
     return(makeBattlePet);
 }
コード例 #2
0
    public AssassinFactory()
    {
        baseModel = Resources.Load <GameObject>("AssassinModel");

        attackPower = 1.2f;
        armor       = 0.1f;
        maxHP       = 6 * 2;
        maxMP       = 6;


        //baseSkills.Add(SkillFactory.GetShiv());
        baseSkills.Add(SkillFactory.GetFade());
        baseSkills.Add(SkillFactory.GetCripple());

        Talent t = new Talent();

        t.name        = "Shadow Drift";
        t.description = "The assassin teleports to any tile within a huge distance.";
        t.IfChosen    = unit => {
            unit.AddSkill(SkillFactory.getShadowDrift());
        };
        talentOptions.Add(t);

        t             = new Talent();
        t.name        = "Leach";
        t.description = "30% of damage dealt is healed.";
        t.IfChosen    = unit =>
        {
            unit.AddEffect(EffectFactory.getVampiricEffect(), -1);
        };
        talentOptions.Add(t);

        t             = new Talent();
        t.name        = "Single Out";
        t.description = "Deal double damage to units with no allies within 3 tiles.";
        t.IfChosen    = unit =>
        {
            unit.AddSkill(SkillFactory.GetShiv());
            unit.AddEffect(EffectFactory.getSingledOutEffect(), -1);
        };
        talentOptions.Add(t);

        t             = new Talent();
        t.name        = "Pierce";
        t.description = "Shiv is replace by pierce, a ranged attack with similar damage.";
        t.IfChosen    = unit =>
        {
            unit.AddSkill(SkillFactory.getPierce());
        };
        talentOptions.Add(t);

        t             = new Talent();
        t.name        = "Efficiency";
        t.description = "Move which slightly heals an ally or slightly damages an enemy. Has no energy cost, and restores energy to the caster.";
        t.IfChosen    = unit =>
        {
            unit.AddSkill(SkillFactory.getEfficiency());
        };
        talentOptions.Add(t);

        t             = new Talent();
        t.name        = "Acid Blade";
        t.description = "Assassin stabs an enemy. Weaker than shiv, but pierces and corrodes an enemy's armor.";
        t.IfChosen    = unit =>
        {
            unit.AddSkill(SkillFactory.getAcidBlade());
        };
        talentOptions.Add(t);

        name        = "Assassin";
        description = "A spooky dangerous assassin, who deals a lot of damage";
        image       = Resources.Load <Sprite>("CharacterIcons/AssassinIcon");
    }
コード例 #3
0
    void Start()
    {
        initialized = true;
        GameManager.instance.units.Add(this);

        /*
         * if (tile == null)
         * {
         *  int i = 0;
         *  while (tile == null)
         *      tile = GameManager.instance.tiles[i++][(int)ID];
         *  tile.SetUnit(this);
         *  transform.position = tile.TopPosition;
         *  //reachableTiles = GameManager.instance.TilesInRange(tile, MoveRange);
         * }
         */

        nextTurnTime = GameManager.instance.TurnTime;

        if (!dontPlace)
        {
            int startI = faction == 0 ? 0 : GameManager.instance.height - 1;
            int endI   = GameManager.instance.height - 1 - startI;
            int dirI   = faction == 0 ? 1 : -1;

            for (int i = startI; i != endI; i += dirI)
            {
                for (int j = 0; j < GameManager.instance.width; ++j)
                {
                    Tile t = GameManager.instance.tiles[j][i];
                    if (t != null && t.unit == null)
                    {
                        t.SetUnit(this);
                        transform.position = tile.TopPosition;
                        break;
                    }
                }
                if (this.tile != null)
                {
                    break;
                }
            }
        }
        else
        {
            GameManager.instance.tempTurnQueueBar.ChangeFuture(GameManager.instance.units);
        }


        if (anim == null)
        {
            if (transform.childCount > 0)
            {
                anim = transform.FindChild("Model").GetComponent <Animator>();
                ik   = transform.FindChild("Model").GetComponent <AnimatorIKProxie>();
            }
        }

        curHP     = maxHP;
        curMP     = maxMP;
        explosion = (GameObject)Resources.Load("SpellVisuals/Explosion");

        if (faction != 0)
        {
            //AddSkill (SkillFactory.GetWeakenOffense ());
            //AddSkill (SkillFactory.GetWeakenDefense());
            //AddSkill(SkillFactory.GetTaunt());
            AddSkill(SkillFactory.GetShiv());
            //AddSkill(SkillFactory.GetFade());
            //AddSkill(SkillFactory.GetBloodDonor());
            //AddSkill (SkillFactory.GetAoEHeal ());
            AddSkill(SkillFactory.GetSnipe());
            //AddSkill(SkillFactory.GetSlam());
            //AddSkill(SkillFactory.GetRepair());
            //AddSkill(SkillFactory.GetPersistence());
            //AddSkill(SkillFactory.GetEpidemic());
        }
    }