protected override void ResetActionSkill() { if (waitArrows == null) { waitArrows = Resources.LoadAssetAtPath("Assets/SRPGKit/Prefabs/Wait Arrows.prefab", typeof(GameObject)) as GameObject; } TargetSettings ts = new TargetSettings(); targetSettings = new TargetSettings[] { ts }; overlayColor = Color.clear; highlightColor = Color.clear; ts.targetingMode = TargetingMode.Cardinal; ts.targetRegion = new Region(); ts.targetRegion.type = RegionType.Self; ts.targetRegion.interveningSpaceType = InterveningSpaceType.Pick; ts.effectRegion = new Region(); ts.effectRegion.type = RegionType.Self; ts.effectRegion.interveningSpaceType = InterveningSpaceType.Pick; StatEffect facingEffect = new StatEffect(); facingEffect.effectType = StatEffectType.ChangeFacing; facingEffect.target = StatEffectTarget.Applier; facingEffect.triggerF = Formula.True(); facingEffect.value = Formula.Lookup("arg.angle.xy", LookupType.SkillParam); StatEffect endTurnEffect = new StatEffect(); endTurnEffect.effectType = StatEffectType.EndTurn; endTurnEffect.target = StatEffectTarget.Applier; endTurnEffect.triggerF = Formula.True(); applicationEffects = new StatEffectGroup { effects = new StatEffect[] { facingEffect, endTurnEffect } }; }
public StatEffectGroup Concat(StatEffectGroup other) { StatEffectGroup ret = new StatEffectGroup(); ret.effects = this.effects.Concat(other.effects).ToArray(); return(ret); }
protected override void ResetActionSkill() { if(waitArrows == null) { waitArrows = Resources.LoadAssetAtPath("Assets/SRPGKit/Prefabs/Wait Arrows.prefab", typeof(GameObject)) as GameObject; } TargetSettings ts = new TargetSettings(); targetSettings = new TargetSettings[]{ts}; overlayColor = Color.clear; highlightColor = Color.clear; ts.targetingMode = TargetingMode.Cardinal; ts.targetRegion = new Region(); ts.targetRegion.type = RegionType.Self; ts.targetRegion.interveningSpaceType = InterveningSpaceType.Pick; ts.effectRegion = new Region(); ts.effectRegion.type = RegionType.Self; ts.effectRegion.interveningSpaceType = InterveningSpaceType.Pick; StatEffect facingEffect = new StatEffect(); facingEffect.effectType = StatEffectType.ChangeFacing; facingEffect.target = StatEffectTarget.Applier; facingEffect.triggerF = Formula.True(); facingEffect.value = Formula.Lookup("arg.angle.xy", LookupType.SkillParam); StatEffect endTurnEffect = new StatEffect(); endTurnEffect.effectType = StatEffectType.EndTurn; endTurnEffect.target = StatEffectTarget.Applier; endTurnEffect.triggerF = Formula.True(); applicationEffects = new StatEffectGroup{effects=new StatEffect[]{ facingEffect, endTurnEffect }}; }
public StatEffectGroup Concat(StatEffectGroup other) { StatEffectGroup ret = new StatEffectGroup(); ret.effects = this.effects.Concat(other.effects).ToArray(); return ret; }
protected virtual void ApplyEffectsTo( Target t, TargetSettings ts, StatEffectGroup[] effectGroups, List<Character> targs, string htp, Vector3 start ) { foreach(Character c in targs) { currentTargetCharacter = c; Debug.Log("current target "+c); int hitType = (int)GetParam(htp, 0); Debug.Log("hitType "+hitType); currentHitType = hitType; SetParam("arg.currentHitType", currentHitType); StatEffect[] effects = effectGroups[Mathf.Min(hitType, effectGroups.Length-1)].effects; Quaternion? oldFacing = t.facing; //FIXME: feels a little (i.e. a lot) hacky Vector3 ep = c.TilePosition; Vector3 tp = start; if(!(Mathf.Approximately(ep.y,tp.y) && Mathf.Approximately(ep.x,tp.x))) { t.facing = Quaternion.Euler( 0, Mathf.Atan2(ep.y-tp.y, ep.x-tp.x)*Mathf.Rad2Deg, 0 ); } SetArgsFromTarget(t, ts, "", start); t.facing = oldFacing; foreach(StatEffect se in effects) { var rec = se.Apply( this, character, currentTargetCharacter ); if(rec != null) { lastEffects.Add(rec); } } } }