public static bool CanICombineWithUnitType(Kimboko combiner, UNITTYPE toCombine)
        {
            if (combiner.UnitType == UNITTYPE.FUSION || toCombine == UNITTYPE.FUSION || toCombine == UNITTYPE.COMBINE)
            {
                return(false);
            }

            int totalPoints;

            int combinerPoints  = PuntuateKimboko(combiner);
            int toCombinePoints = PuntuateUnitType(toCombine);

            totalPoints = combinerPoints + toCombinePoints;

            switch (totalPoints)
            {
            case 2:
            case 5:
            case 7:
            case 8:
            case 18:
            case 34:
            case 39:
            case 55:
            case 116:
            case 132:
            case 136:
            case 138:
                return(true);

            default:
                return(false);
            }
        }
 public SpawnAbilityEventInfo(Player spawnerPlayer, UNITTYPE spawnUnitType, Tile spawnTile, int spawnIndexID)
 {
     this.spawnerPlayer = spawnerPlayer;
     this.spawnUnitType = spawnUnitType;
     this.spawnTile     = spawnTile;
     this.spawnIndexID  = spawnIndexID;
 }
        public static int PuntuateUnitType(UNITTYPE unitType)
        {
            int totalPoints = 0;

            switch (unitType)
            {
            case UNITTYPE.X:
                totalPoints += Xpoints;
                break;

            case UNITTYPE.Y:
                totalPoints += Ypoints;
                break;

            case UNITTYPE.Z:
                totalPoints += Zpoints;
                break;

            case UNITTYPE.FUSION:
                return(0);

            default:
                return(0);
            }

            return(totalPoints);
        }
Beispiel #4
0
        public Kimboko(int ID, Player ownerPlayer, UNITTYPE UnitType, MOVEDIRECTIONTYPE MoveDirectionerType)
        {
            this.ID        = ID;
            OwnerPlayerID  = ownerPlayer.OwnerPlayerID;
            CardTargetType = CARDTARGETTYPE.UNIT;
            OccupierType   = OCUPPIERTYPE.UNIT;

            this.UnitType            = UnitType;
            this.MoveDirectionerType = MoveDirectionerType;
        }
Beispiel #5
0
 public Unit(string name, int hp, int strength, float movement, UNITTYPE unitType)
 {
     Name              = name;
     HP                = hp;
     Strength          = strength;
     Movement          = movement;
     MovementRemaining = movement;
     UnitType          = unitType;
     hexPath           = new Queue <Hex>();
 }
    private Unit SpawnOrRecycleUnit(UNITTYPE type)
    {
        Unit unitToReturn = null;

        // Iterate through existing garbage list first.
        foreach (Unit u in listGarbageUnits)
        {
            switch (type)
            {
            case UNITTYPE.A:
                //Check for 2 conditions: Unit Type and availability.
                if (u.unitType == UNITTYPE.A && !u.isActiveAndEnabled)
                {
                    unitToReturn = u;
                }
                break;

            case UNITTYPE.B:
                if (u.unitType == UNITTYPE.B && !u.isActiveAndEnabled)
                {
                    unitToReturn = u;
                }
                break;

            case UNITTYPE.C:
                if (u.unitType == UNITTYPE.C && !u.isActiveAndEnabled)
                {
                    unitToReturn = u;
                }
                break;
            }
        }

        // Now, if it's still null, then we instantiate and return.

        if (unitToReturn == null)
        {
            // Iterate through unit prefabs and inst.
            foreach (Unit prefabUnit in prefabUnits)
            {
                if (prefabUnit.unitType == type)
                {
                    GameObject inst = Instantiate(prefabUnit.gameObject, Vector3.zero, Quaternion.identity) as GameObject;
                    unitToReturn = inst.GetComponent <Unit>();

                    // Add to garbage list.
                    listGarbageUnits.Add(unitToReturn);
                }
            }
        }
        return(unitToReturn);
    }
    private void SpawnUnit(UNITFACTION faction, UNITTYPE type)
    {
        // Spawn unit gameobject first.
        Unit unitToSpawn = SpawnOrRecycleUnit(type);

        // Attach a stats UI to it as well.
        unitToSpawn.statsUI = SpawnOrRecycleStatsUI();

        if (faction == UNITFACTION.PLAYER)
        {
            // Set camera focus on unit.
            camOrtho.Follow = unitToSpawn.transform;
            unitPlayer      = unitToSpawn;
            unitToSpawn.transform.position = new Vector3(0f, 0f, 1f);
        }
        else if (faction == UNITFACTION.ENEMY)
        {
            // Find the furthest spawn point from player.
            unitToSpawn.transform.position = GetFurthestSpawnPoint();
        }

        unitToSpawn.gameObject.SetActive(true);
        unitToSpawn.Init(faction);
    }
Beispiel #8
0
 /// <summary>
 /// ユニットタイプを設定
 /// </summary>
 /// <param name="type">
 /// A <see cref="UNITTYPE"/>
 /// </param>
 protected void setUnitType( UNITTYPE type )
 {
     mUnitType = type;
 }
 public UNITTYPE evolvedType; // A QUE TIPO EVOLUCIONO
 public EvolveAbilityEventInfo(Kimboko evolver, UNITTYPE startType, UNITTYPE evolvedType)
 {
     this.evolver     = evolver;
     this.evolvedType = evolvedType;
     this.startType   = startType;
 }
Beispiel #10
0
 public TargetUnitTypeFiltter(UNITTYPE unitType) : base(OC_TYPE, FILTTER_ID)
 {
     this.unitType = unitType;
 }
        public static bool CanICombineAndEvolveWithUnitType(Kimboko combinerCharacter, UNITTYPE toCombineCharacter)
        {
            if (combinerCharacter.UnitType == UNITTYPE.FUSION || toCombineCharacter == UNITTYPE.FUSION)
            {
                return(false);
            }
            if (combinerCharacter.UnitType != UNITTYPE.X && toCombineCharacter != UNITTYPE.X)
            {
                return(false);
            }

            int totalPoints;
            int combinerPoints  = PuntuateKimboko(combinerCharacter);
            int toCombinePoints = PuntuateUnitType(toCombineCharacter);

            totalPoints = combinerPoints + toCombinePoints;

            switch (totalPoints)
            {
            case 22:
            case 41:
            case 121:
                return(true);

            default:
                return(false);
            }
        }