public override void populateSelf(Cardmaker maker, bool isPrefab) { Ability ab = maker.GetComponent <Ability>(); Ordnance ord = maker.GetComponent <Ordnance>(); // if (ord.cardArt != null) { populateArt(ord.cardArt); } else { populateArt(maker.gameObject); } if (isPrefab) { populateTitle(maker.name); } else { populateTitle(maker.originalName); } setBackground(); populateCost(maker.resourceCost.ToString()); populateBody(ab); }
public void abilityCast(uint ownerID, uint abilID, uint tileID) { if (!messageCheck(ownerID, abilID, tileID)) { return; } Ordnance castAbility = NetworkIdentity.spawned[abilID].GetComponent <Ordnance>(); PlayerGhost player = NetworkIdentity.spawned[ownerID].GetComponent <PlayerGhost>(); Targeting t = castAbility.GetComponent <Targeting>(); Tile target = NetworkIdentity.spawned[tileID].GetComponent <Tile>(); if ( castAbility && player.getCurrentResources() >= castAbility.resourceCost && castAbility.caster.canCast //&& t.evaluate(target, teams[ownerID], castAbility.caster.loc) //Inside cast now ) { if (castAbility.castAbil(target, castAbility.getTeam(), castAbility.caster.loc)) { player.spendResources(castAbility.resourceCost); pipe.RpcAddViewEvent(new ViewEvent(ViewType.playEffect, abilID, tileID, Time.time)); } } }
public void addAbility(Ordnance abilityInstance) { GameObject abilToken = Instantiate(ordSqPre, transform); abilToken.GetComponent <OrdSqUI>().intialize(abilityInstance.GetComponent <Ordnance>()); AbilsSqs.Add(abilToken); //LayoutRebuilder.ForceRebuildLayoutImmediate(GetComponent<RectTransform>()); }
void createInspection(inspectBlock b) { switch (b.type) { case inspectType.card: handSample = Instantiate(b.obj, transform); handSample.transform.localPosition = Vector3.zero; if (b.stats != null) { generateKeywordDesc(b.stats); } break; case inspectType.cardmaker: case inspectType.cardmakerPre: bool isPre = b.type == inspectType.cardmakerPre; Unit u = b.obj.GetComponent <Unit>(); Ordnance o = b.obj.GetComponent <Ordnance>(); Equipment e = b.obj.GetComponent <Equipment>(); if (u) { //generateKeywordDesc(u.stat.export()); visualsUnit.populateSelf(u, isPre); visualsUnit.gameObject.SetActive(true); } else if (o) { visualsAbility.populateSelf(o, isPre); visualsAbility.gameObject.SetActive(true); } else if (e) { //generateKeywordDesc(e.GetComponent<StatHandler>().export()); visualsBuff.populateSelf(e, isPre); visualsBuff.gameObject.SetActive(true); } if (isPre) { if (b.stats != null) { generateKeywordDesc(b.stats); } } else { if (u || e) { generateKeywordDesc(b.obj.GetComponent <StatHandler>().export()); } } break; } }
void RpcParentAbility(uint abID) { if (NetworkIdentity.spawned.ContainsKey(abID)) { NetworkIdentity ab = NetworkIdentity.spawned[abID]; ab.transform.parent = transform; ab.transform.localPosition = Vector3.zero; Ordnance o = ab.GetComponent <Ordnance>(); o.caster = this; if (!isServer) { abilities.Add(o); } } }
public GameObject createAbility(GameObject o) { GameObject ab = Instantiate(o, transform); Ordnance ord = ab.GetComponent <Ordnance>(); ord.provideName(o.name); ord.caster = this; Ability abil = ab.GetComponent <Ability>(); abil.initialize(); NetworkIdentity netI = ab.GetComponent <NetworkIdentity>(); abilities.Add(ord); NetworkServer.Spawn(ab); RpcParentAbility(netI.netId); return(ab); }
private void AddToDisplay(Ordnance o) { Parent.Children.Add(o.Geometry); }
private bool RemoveFromDisplay(Ordnance o) { Parent.Children.Remove(o.Geometry); return(true); }
public void Fire(GameObject owner) { Ordnance ordnanceInstance = Instantiate(OrdnanceType, FirePoint.transform.position, FirePoint.transform.rotation); ordnanceInstance.owner = owner; }
public void intialize(Ordnance o) { ability = o; buildGraphic(); }
public void removeAbility(Ordnance o) { abilities.Remove(o); }