public DamageAttackerTrigger (string name, Unit caster, int dur, PrefabLibrary el, int dmg, TriggerType TT, Sprite icon = null)
		: base(name, TT, caster, el, dur, icon)
	{
		maxTriggers = -1;
		damage = dmg;
		description = "When this unit takes damage, " + damage.ToString () + " damage is dealt back to the attacker.";
	}
Exemplo n.º 2
0
        public void InitMap(MapGenerationParameters genParams, Transform transform)
        {
            this.genParams = genParams;

            //Generate map info
            _mapInfo = mapGen.GetRandomMapInfo(genParams.seed, genParams.size);

            //Setup tile-drilling
            tileDrillDict = new Dictionary <Pos, float>();

            //Generate chunk parameters
            int chunkAmount = mapInfo.size / mapInfo.chunkSize;

            _mapChunks = new MapChunk[chunkAmount, chunkAmount];

            //Initialize chunk graphics-tile maps
            var graphicsGroundMap    = MapGrahicsHelper.GetGraphicsGroundMap(mapInfo.groundMap);
            var graphicsBlockMap     = MapGrahicsHelper.GetGraphicsBlockMap(mapInfo.blockMap);
            var graphicsGroundChunks = MapGrahicsHelper.SplitArray(graphicsGroundMap, chunkAmount);
            var graphicsBlockChunks  = MapGrahicsHelper.SplitArray(graphicsBlockMap, chunkAmount);

            //Create chunks
            for (int x = 0; x < chunkAmount; x++)
            {
                for (int y = 0; y < chunkAmount; y++)
                {
                    var chunkObj = PrefabLibrary.Create("MapChunk");
                    chunkObj.transform.SetParent(transform, false);
                    chunkObj.GetComponent <MapChunk>().GenerateChunk(graphicsGroundChunks[x, y], graphicsBlockChunks[x, y], x * mapInfo.chunkSize, y * mapInfo.chunkSize, mapInfo.chunkSize);
                    _mapChunks[x, y] = chunkObj.GetComponent <MapChunk>();
                }
            }
        }
Exemplo n.º 3
0
	public Clobber (Unit u, TileMap m, PrefabLibrary el) : base(u, m , el)
	{
		damage = 30;
		range = 1;
		area = AreaType.Single;
		targets = TargetType.Enemy;
		maxCooldown = 1;
	}
Exemplo n.º 4
0
	public ManaTrap (Unit u, TileMap m, PrefabLibrary el) : base(u, m , el)
	{
		manaCost = 0;
		duration = 2;
		maxCooldown = 3;
		range = 6;
		area = AreaType.Floor;
		targets = TargetType.Enemy;
	}
Exemplo n.º 5
0
    public AxeThrow(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        damage = 25;
        range = 5;
        area = AreaType.Single;
        targets = TargetType.Enemy;
        maxCooldown = 1;

        AIRanged = true;
    }
Exemplo n.º 6
0
 public CounterAttack(Unit u, TileMap m, PrefabLibrary el)
     : base(u, m , el)
 {
     Name = "Counter Attack";
     damage = 15;
     duration = 2;
     area = AreaType.Self;
     targets = TargetType.Enemy;
     maxCooldown = 6;
     description = "Cooldown: " + maxCooldown.ToString () +
         "\nIncreases block chance by " + blockIncrease.ToString() + "% times your current Guard Points for "  + duration.ToString() + " turns and deals " + damage.ToString() + " damage to attackers after blocking.";
 }
Exemplo n.º 7
0
    public SpawnTotem(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Spawn Totem";
        duration = 2;
        range = 4;
        area = AreaType.Single;
        targets = TargetType.Enemy;
        maxCooldown = 4;

        AIPriority = 0;
    }
Exemplo n.º 8
0
    public TotemPushBack(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        range = 6;
        area = AreaType.Self;
        targets = TargetType.Ally;
        maxCooldown = 4;
        shield = 50;

        AIPriority = 100;
        AIRanged = true;
        AISupportsAlly = true;
    }
Exemplo n.º 9
0
 public Charge(Unit u, TileMap m, PrefabLibrary el)
     : base(u, m , el)
 {
     Name = "Charge";
     damage = 10;
     duration = 2;
     range = 5;
     area = AreaType.Line;
     targets = TargetType.Enemy;
     maxCooldown = 3;
     description = "Cooldown: " + maxCooldown.ToString () +
         "\nCharges in a direction until she hits a wall or unit. Deals " + damage.ToString() + " damage and snares the target for " + duration.ToString() + " turns.";
 }
Exemplo n.º 10
0
    public Flurry(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Flurry";
        damage = 20;
        range = 1;
        area = AreaType.Single;
        targets = TargetType.Enemy;
        maxCooldown = 3;

        description = "Cooldown: " + maxCooldown.ToString () +
            "\nDeals " + damage.ToString () + " damage multiplied by the number of Lacerates on the target.";
    }
Exemplo n.º 11
0
    public HammerSlam(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Hammer Slam";
        damage = 40;
        duration = 2;
        range = 1;
        area = AreaType.Single;
        targets = TargetType.Enemy;
        maxCooldown = 3;

        AIPriority = 10;
    }
Exemplo n.º 12
0
    public Combustion(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Combustion";
        damage = 20;
        duration = 1;
        range = 3;
        area = AreaType.Single;
        targets = TargetType.Enemy;
        maxCooldown = 3;

        AIPriority = 4;
    }
    public TotemCooldownReduction(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        range = 6;
        duration = 1;
        area = AreaType.Self;
        targets = TargetType.Ally;
        maxCooldown = 1;

        AIPriority = 10;
        AIRanged = true;
        AISupportsAlly = true;
    }
Exemplo n.º 14
0
 public CripplingShot(Unit u, TileMap m, PrefabLibrary el)
     : base(u, m , el)
 {
     Name = "Crippling Shot";
     damage = 20;
     manaCost = 20;
     duration = 2;
     area = AreaType.Single;
     targets = TargetType.Enemy;
     range = 5;
     maxCooldown = 1;
     description = "Cooldown: " + maxCooldown.ToString () + " Mana: " + manaCost.ToString () +
         "\nDeals " + damage.ToString () + " damage to the target and applies a snare for " + duration.ToString() + " turns.";
 }
Exemplo n.º 15
0
 public Amplify(Unit u, TileMap m, PrefabLibrary el)
     : base(u, m , el)
 {
     Name = "Amplify";
     manaCost = 30;
     duration = 2;
     maxCooldown = 3;
     range = 5;
     AOERange = 2;
     area = AreaType.AOE;
     targets = TargetType.All;
     description = "Cooldown: " + maxCooldown.ToString () + " Mana: " + manaCost.ToString () +
         "\nSpeads out a 100% modifier accross allies and enemies, increasing ally damage and reducing enemies for " + duration.ToString() + " turns.";
 }
Exemplo n.º 16
0
    public Inspire(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        range = 6;
        duration = 2;
        manaCost = 25;
        area = AreaType.Self;
        targets = TargetType.Ally;
        maxCooldown = 4;

        AIPriority = 10;
        AIRanged = true;
        AISupportsAlly = true;
    }
Exemplo n.º 17
0
    public FlamingAxe(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Flaming Axe";
        damage = 50;
        duration = 1;
        range = 4;
        area = AreaType.Single;
        targets = TargetType.Enemy;
        maxCooldown = 3;
        stacks = 9;

        AIPriority = 15;
    }
Exemplo n.º 18
0
    public ArcaneSpark(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Arcane Spark";
        damage = 120;
        manaCost = 0;
        maxCooldown = 2;
        range = 6;
        area = AreaType.Single;
        targets = TargetType.Enemy;

        description = "Cooldown: " + maxCooldown.ToString () + " Mana: 100%" +
            "\nDeals " + damage.ToString () + " damage to the target multiplied by your remaining mana percentage. Cannot be dodged or blocked.";
    }
Exemplo n.º 19
0
    public TotemSnare(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        range = 1;
        duration = 2;
        area = AreaType.SelfAOE;
        targets = TargetType.Enemy;
        maxCooldown = 1;
        AOERange = 3;

        AIPriority = 1;
        AIRanged = false;
        AISupportsAlly = false;
    }
Exemplo n.º 20
0
    public TotemFlameShield(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        range = 6;
        duration = 3;
        area = AreaType.Self;
        targets = TargetType.Ally;
        maxCooldown = 4;
        damage = 7;

        AIPriority = 100;
        AIRanged = true;
        AISupportsAlly = true;
    }
Exemplo n.º 21
0
    public TripleShot(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Triple Shot";
        damage = 10;
        manaGain = 5;
        range = 7;
        maxCooldown = 1;
        area = AreaType.Single;
        targets = TargetType.Enemy;

        description = "Cooldown: " + maxCooldown.ToString () +
            "\nFires 3 arrows that deal " + damage.ToString () + " damage each to the target and the caster gains " + manaGain.ToString() + " mana per arrow hit.";
    }
Exemplo n.º 22
0
    public SmokeBomb(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Smoke Bomb";
        damage = 0;
        duration = 3;
        range = 1;
        area = AreaType.Self;
        targets = TargetType.Ally;
        maxCooldown = 10;

        description = "Cooldown: " + maxCooldown.ToString () +
            "\nDrops a smoke bomb that slightly reduces vision in the area and increase the dodge chance of allies in it by " + dodgeMod.ToString () + "% lasting " + duration.ToString() + " turns.";
    }
Exemplo n.º 23
0
    public ExploitWeakness(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Exploit Weakness";
        damage = 30;
        manaCost = 25;
        area = AreaType.Single;
        targets = TargetType.Enemy;
        range = 9;
        maxCooldown = 1;

        description = "Cooldown: " + maxCooldown.ToString () + " Mana: " + manaCost.ToString () +
            "\nDeals " + damage.ToString () + " damage to the target and deals double damage if the target is stunned or snared.";
    }
Exemplo n.º 24
0
 public FlashFreeze(Unit u, TileMap m, PrefabLibrary el)
     : base(u, m , el)
 {
     Name = "Flash Freeze";
     damage = 20;
     manaCost = 30;
     duration = 1;
     maxCooldown = 3;
     range = 5;
     AOERange = 2;
     area = AreaType.AOE;
     targets = TargetType.All;
     description = "Cooldown: " + maxCooldown.ToString () + " Mana: " + manaCost.ToString () +
         "\nDeals " + damage.ToString () + " damage to both allies and enemies and stuns them for " + duration.ToString() + " turns.";
 }
Exemplo n.º 25
0
 public DivineSacrifice(Unit u, TileMap m, PrefabLibrary el)
     : base(u, m , el)
 {
     Name = "Divine Sacrifice";
     damage = 10;
     manaGain = 4;
     duration = 4;
     range = 6;
     area = AreaType.Single;
     targets = TargetType.Enemy;
     maxCooldown = 1;
     description = "Cooldown: " + maxCooldown.ToString () +
         "\nDeals " + damage.ToString () + " damage to the target and each time the target takes damage, the caster gains " + manaGain.ToString() +
             " mana. Lasts " + duration.ToString() + ".";
 }
Exemplo n.º 26
0
    public TotemMist(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Smoke Bomb";
        damage = 0;
        duration = 1;
        range = 1;
        area = AreaType.Self;
        targets = TargetType.Ally;
        maxCooldown = 4;

        AIPriority = 100;
        AIRanged = true;
        AISupportsAlly = true;
    }
Exemplo n.º 27
0
    public ShadowStep(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Shadow Step";
        duration = 3;
        range = 6;
        area = AreaType.Floor;
        targets = TargetType.Enemy;
        maxCooldown = 2;
        stacks = 5;

        description = "Cooldown: " + maxCooldown.ToString () +
            "\nTeleports to the target location and makes all enemies around bleed for " + bleedDmg.ToString() + " damage each turn for " + duration.ToString() +
                " turns. Stacks " + stacks + " times.";
    }
Exemplo n.º 28
0
    public Lunge(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Lunge";
        damage = 20;
        duration = 1;
        range = 3;
        area = AreaType.Line;
        targets = TargetType.Enemy;
        maxCooldown = 4;

        description = "Cooldown: " + maxCooldown.ToString () +
            "\nAfter a single square dash, jumps over all units until it finds an empty square. Deals " + damage.ToString () +
                " damage to the first target if its an enemy and gains 1 combo point per enemy leaped over.";
    }
Exemplo n.º 29
0
    public Barge(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        Name = "Barge";
        damage = 25;
        duration = 2;
        range = 1;
        area = AreaType.Single;
        targets = TargetType.Enemy;
        maxCooldown = 2;

        description = "Cooldown: " + maxCooldown.ToString () +
            "\nBarges the target for " + damage.ToString () +
                " damage, pushes them back 1 square and snares them. If the target is larger than the caster, it is not pushed back. Gain 2 Guard Points";
    }
Exemplo n.º 30
0
    public SonicWave(Unit u, TileMap m, PrefabLibrary el)
        : base(u, m , el)
    {
        damage = 20;
        manaGain = 15;
        range = 6;
        duration = 2;
        area = AreaType.Single;
        targets = TargetType.Enemy;
        maxCooldown = 4;

        AIPriority = 5;
        AIRanged = true;
        AISupportsAlly = false;
    }
Exemplo n.º 31
0
 public ArcanePulse(Unit u, TileMap m, PrefabLibrary el)
     : base(u, m , el)
 {
     Name = "Arcane Pulse";
     manaCost = 0;
     manaGain = 20;
     maxCooldown = 1;
     damage = 25;
     range = 5;
     area = AreaType.Single;
     targets = TargetType.Enemy;
     description = "Cooldown: " + maxCooldown.ToString () +
         "\nDeals increased damage the lower the units mana. If the target doesn't use mana, deals " + damage.ToString () +
             " damage. The caster gains " + manaGain.ToString() + " mana if the attack hits.";
 }
Exemplo n.º 32
0
    public static void CreateObj(Type type, Vector3 pos, Vector3 ang, int clId, int uId)
    {
        //Create the go
        hl.Peer peer = hl.GetPeerForUID(clId);
        Obj     obj  = new Obj();

        obj.type = type;
        obj.go   = Instantiate(PrefabLibrary.GetPrefabForType(type));
        obj.go.transform.position         = pos;
        obj.go.transform.localEulerAngles = ang;
        obj.ownedByClId = clId;
        obj.uId         = uId;
        obj.goal        = pos;

        switch (type)
        {
        case Type.Marine:
            obj.isUnit = true;                    //This obj is a unit, and can be selected.
            //create selectionCircle
            obj.selectionCircle = (GameObject)Instantiate(xa.de.selectionCirclePrefab, pos, new Quaternion(0, 0, 0, 0));

            obj.selectionCircle.transform.parent        = obj.go.transform;
            obj.selectionCircle.transform.localPosition = Vector3.zero;
            obj.selectionCircle.SetActive(false);
            obj.textMesh      = obj.go.GetComponentInChildren <TextMesh>();
            obj.textMesh.text = "";                    //uId: " + obj.uId + "\nClId: " + obj.ownedByClId;
            obj.go.GetComponent <Info>().uId = obj.uId;
            obj.animator = obj.go.GetComponent <Info>().animator;
            int[] cost = GetCostForType(type);
            obj.popCost       = cost[0];
            obj.moneyCost     = cost[1];
            obj.muntionsCost  = cost[2];
            obj.fuelCost      = cost[3];
            obj.priorityValue = 1;
            obj.health        = 100;
            break;
        }

        objs.Add(obj);
    }
    public override void OnInspectorGUI()

    {
        PrefabLibrary lib = target as PrefabLibrary;



        EditorGUILayout.BeginHorizontal();

        GUILayout.Label("Key");

        GUILayout.Label("Prefab");

        bool bAddNew = GUILayout.Button("New");

        EditorGUILayout.EndHorizontal();



        if (bAddNew)

        {
            lib.Set("New Key #" + lib.Keys.Count, null);
        }



        for (int nIndex = 0; nIndex < lib.Keys.Count; ++nIndex)

        {
            string key = lib.Keys[nIndex];

            GameObject obj = lib.Values[nIndex];



            EditorGUILayout.BeginHorizontal();

            lib.Keys[nIndex] = GUILayout.TextField(key);

            lib.Values[nIndex] = EditorGUILayout.ObjectField(obj, typeof(GameObject), false) as GameObject;

            bool bDelete = GUILayout.Button("Delete");

            EditorGUILayout.EndHorizontal();



            if (bDelete)

            {
                lib.Remove(key);

                break;
            }
        }



        EditorUtility.SetDirty(target);
    }
 void Start()
 {
     Instance = this;
 }
Exemplo n.º 35
0
    public static void CreateObj(Type type, Vector3 pos, Vector3 ang, int clId, int uId)
    {
        //Create the go
        Obj obj = new Obj();

        obj.type = type;
        obj.go   = (GameObject)Instantiate(PrefabLibrary.GetPrefabForType(type), pos, new Quaternion(0, 0, 0, 0));
        obj.go.transform.localEulerAngles = ang;
        obj.ownedByClId = clId;
        obj.uId         = uId;
        obj.goal        = pos;

        switch (type)
        {
        case Type.CommandPod:
            obj.isUnit = true;                    //This obj is a unit, and can be selected.
            //create selectionCircle
            obj.selectionCircle = (GameObject)Instantiate(xa.de.selectionCirclePrefab, pos, new Quaternion(0, 0, 0, 0));
            obj.selectionCircle.transform.parent        = obj.go.transform;
            obj.selectionCircle.transform.localPosition = Vector3.zero;
            obj.selectionCircle.SetActive(false);
            obj.textMesh      = obj.go.GetComponentInChildren <TextMesh>();
            obj.textMesh.text = "uId: " + obj.uId + "\nClId: " + obj.ownedByClId;
            obj.go.GetComponent <Info>().uId = obj.uId;
            obj.mainBodyRenderers            = obj.go.GetComponent <Info>().mainBodyRenderers;

            InitGrid(obj);
            CreateGridSqPrefabs(obj);
            Vector2 gridPos = GlobalPosToGridXY(obj, obj.go.transform.position);
            obj.gridPos = gridPos;
            //Debug.Log("GridPos: " + gridPos);
            RegisterOnGrid(obj, obj, gridPos);   //Register this unit on its own grid
            TurnOffGrid(obj);                    //Turns off this grid, since it was probably created as visible.
            //TurnOnAllValidGridSquares(obj);
            break;

        case Type.HullBlock:
            obj.go.GetComponent <Info>().uId = obj.uId;
            obj.mainBodyRenderers            = obj.go.GetComponent <Info>().mainBodyRenderers;
            obj.textMesh      = obj.go.GetComponentInChildren <TextMesh>();
            obj.textMesh.text = "gridXY";
            break;

        case Type.Engine:
            obj.go.GetComponent <Info>().uId = obj.uId;
            obj.mainBodyRenderers            = obj.go.GetComponent <Info>().mainBodyRenderers;
            obj.textMesh      = obj.go.GetComponentInChildren <TextMesh>();
            obj.textMesh.text = "gridXY";
            break;

        case Type.Gun:
            obj.go.GetComponent <Info>().uId = obj.uId;
            obj.mainBodyRenderers            = obj.go.GetComponent <Info>().mainBodyRenderers;
            obj.textMesh        = obj.go.GetComponentInChildren <TextMesh>();
            obj.textMesh.text   = "gridXY";
            obj.range           = 15;
            obj.firingConeAngle = 15;
            break;
        }

        objs.Add(obj);
    }