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."; }
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>(); } } }
public Clobber (Unit u, TileMap m, PrefabLibrary el) : base(u, m , el) { damage = 30; range = 1; area = AreaType.Single; targets = TargetType.Enemy; maxCooldown = 1; }
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; }
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; }
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."; }
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; }
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; }
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."; }
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."; }
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; }
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; }
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."; }
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."; }
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; }
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; }
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."; }
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; }
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; }
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."; }
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."; }
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."; }
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."; }
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() + "."; }
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; }
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."; }
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."; }
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"; }
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; }
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."; }
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; }
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); }