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);
 }
 public static Skill GetMakeSentry()
 {
     if (makeSentry == null)
     {
         makeSentry                    = new Skill();
         makeSentry.name               = "Sentry";
         makeSentry.icon               = Resources.Load <Sprite>("SpellVisuals/TECH/SENTRY/sentry");
         makeSentry.description        = "Creates a sentry that dishes out Snipe attacks with no remores. Lasts 5 turns";
         makeSentry.manaCost           = user => 3;
         makeSentry.targetType         = Skill.TargetType.NONE;
         makeSentry.tileRestriction    = Skill.TargetTileRestriction.EMPTY;
         makeSentry.cooldown           = 5;
         makeSentry.range              = 2;
         makeSentry.OnTilePostEffects += (user, tile, args) =>
         {
             GameObject go = (GameObject)GameObject.Instantiate((GameObject)Resources.Load("SentryModel"), tile.transform.position, user.transform.rotation);
             Unit       u  = go.AddComponent <Unit>();
             u.icon      = Resources.Load <Sprite>("CharacterIcons/SentryIcon");
             u.dontPlace = true;
             tile.SetUnit(u);
             u.faction       = user.faction;
             u.aiControlled  = true;
             u.baseMoveRange = 0;
             u.maxMP         = 10;
             u.maxHP         = 10;
             u.AddSkill(SkillFactory.GetSnipe());
             u.AddEffect(EffectFactory.getDoomEffect(), 5);
         };
         makeSentry.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_Fire_Projectile(user.transform.position + Vector3.up, tile.transform.position + Vector3.up, (GameObject)Resources.Load("SpellVisuals/TECH/SENTRY/sentry projectile prefab"), 4));
             GameManager.instance.tasks.Add(new Task_PlaySound(Resources.Load <AudioClip>("SE/Magic4")));
             makeSentry.EnqueueExecuteTask(user, tile, args);
         };
     }
     return(makeSentry);
 }
示例#3
0
    public TechFactory()
    {
        baseModel = Resources.Load <GameObject>("TechModel");

        attackPower = 0.9f;
        armor       = 0.4f;
        maxHP       = 10;
        maxMP       = 6;


        baseSkills.Add(SkillFactory.GetSnipe());
        baseSkills.Add(SkillFactory.GetRepair());
        baseSkills.Add(SkillFactory.GetMakeSentry());

        Talent t = new Talent();

        t.name        = "Med Station";
        t.description = "Able to create med stations. Static structures that restore health to nearby allies every turn.";
        t.IfChosen    = unit => {
            unit.AddSkill(SkillFactory.getMakeMedStation());
        };
        talentOptions.Add(t);

        t             = new Talent();
        t.name        = "Add Repair";
        t.description = "Adds Repair to Class";
        t.IfChosen    = unit =>
        {
            unit.AddSkill(SkillFactory.GetRepair());
        };
        talentOptions.Add(t);

        t             = new Talent();
        t.name        = "Battle Bot";
        t.description = "Creates a mobile robot buddy. Will move to and attack enemies for you.";
        t.IfChosen    = unit =>
        {
            unit.AddSkill(SkillFactory.getMakeBattlePet());
        };
        talentOptions.Add(t);

        t             = new Talent();
        t.name        = "Sticky Grenade";
        t.description = "Attaches a sticky grenade to an enemy, which explodes after 2 turns.";
        t.IfChosen    = unit =>
        {
            unit.AddSkill(SkillFactory.getStickyGrenade());
        };
        talentOptions.Add(t);

        t             = new Talent();
        t.name        = "Master Sniper";
        t.description = "Snipe is free.";
        t.IfChosen    = unit =>
        {
            unit.talentTags.Add("FreeSnipe");
        };
        talentOptions.Add(t);

        t             = new Talent();
        t.name        = "Toughness";
        t.description = "The Tech is just tough. Nothing complicated. Slight increase to armor and damage.";
        t.IfChosen    = Unit =>
        {
            Unit.AddEffect(EffectFactory.getToughEffect(), -1);
        };
        talentOptions.Add(t);

        name        = "Technician";
        description = "A repairman who can build robots";
        image       = Resources.Load <Sprite>("CharacterIcons/TechIcon");
    }
示例#4
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());
        }
    }