//Indikatioren für Varibeltypen //§=TriggerValue,constantValue //$=StringValue //%=NumericValue //Aufbau des Sykripts //Trigger //Variabel //Skript public EffectScriptObject(string _Script, IRPGSource _Source, RPGObject _Target, TEffect _Effect) { Source = _Source; Afflicted = _Target; string[] Lines = _Script.Split (';'); int state = 0; for (int i=0; i<Lines.Length; i++) { Lines [i] = Lines [i].ToLower (); if (Lines [i] == "endblock") { state++; continue; } if (state == 0) { //Trigger } else if (state == 1) { //Variablen string varstring = Lines [i]; if (varstring [0] == '$') { sValues.Add (new StringValue (varstring.Split ('=') [0].TrimStart ('$'), varstring.Split ('=') [1])); } if (varstring [0] == '%') { nValues.Add (new NumericValue (varstring.Split ('=') [0].TrimStart ('%'), System.Convert.ToInt16 (varstring.Split ('=') [1]))); } } else if (state == 2) { //Script Script.Add (Lines [i]); } } }
public void faceTo(Object obj, RPGObject face) { Script s = current; s.param["npc"] = obj; s.param["face"] = face; s.translate = () => (s.param["npc"] == null ? "[#Red]当前角色[]" : "[#Red]" + obj + "[]") + "面朝向至[#Green]" + getFaceName((RPGObject)s.param["face"]) + "[]"; s.onClick = () => { var form = new FaceToForm().init(s); form.ShowDialog(); }; s.getScript = () => "faceTo(" + (s.param["npc"] == null ? "" : (((NPC)s.param["npc"]).varName + ",")) + "RPGObject." + s.param["face"] + ");"; }
private String getFaceName(RPGObject face) { switch (face) { case RPGObject.FACE_D: return("下方"); case RPGObject.FACE_L: return("左侧"); case RPGObject.FACE_R: return("右侧"); case RPGObject.FACE_U: return("上方"); } return(face.ToString()); }
public static void UseAbility(int ablitiyID, RPGObject caster) { if (AbilityList.Count > 0) { var abilities = from ability in AbilityList where ability.ID == ablitiyID select ability; foreach (var a in abilities) { a.AbilityFunction.Invoke(new List <AbilityArgs>() { new AbilityArgs(caster) }); } } }
public DamageResistance(DamageTypes damageType, int value, RPGObject source) { DamageType = damageType; Value = value; Source = source; }
public DamageResistance(string name, int value, RPGObject source) { DamageTypeName = name; Value = value; Source = source; }
//Informationen //Diese Funktion benutzt das Objekt um Informationen über das Target zu sammeln. DeepSearch offenbart alle Informationen die das StrongRequirements "NeedAnalyze" haben public virtual string[] getInformation(RPGObject Sender, bool IsDeepSearchesing=false) { return null; }
public void HookUp(IRPGSource source,RPGObject afflicted,ulong id) { this.afflicted = afflicted; _ownID = id; cDuration = oDuration; OriginalSource = source; scriptObjects = new EffectScriptObject[ActiveEffectStrings.Length]; for (int i=0; i<scriptObjects.Length; i++) scriptObjects [i] = new EffectScriptObject (ActiveEffectStrings [i], source, afflicted, this); }
//Use Original FuctionNames void ProcessCommandToObject(RPGObject target,string Command ,string[] CallParameter, Paramter[] Triggerparameter) { List<NumericValue> numericOutput = new List<NumericValue> (); List<StringValue> stringOutput = new List<StringValue> (); switch (Command) { case "recievedamage": numericOutput.Add(new NumericValue("output0",target.recieveDamage(collectNumericValue(CallParameter[0],Triggerparameter),collectStringValue(CallParameter[1]),collectIRPGSource(CallParameter[2],Triggerparameter)))); break; case "updatestatistics": target.updateStatistics(); break; case "addeffect": if(CallParameter.Length==1) target.addEffect(collectIRPGSource(CallParameter[0])as TEffect,this.source); else target.addEffect(RPGCore.instance.spawnEffect(CallParameter[0]),this.source); break; } nValues.RemoveAll(delegate(NumericValue obj) { return obj.Name.Contains("output"); }); sValues.RemoveAll(delegate(StringValue obj) { return obj.Name.Contains("output"); }); nValues.AddRange (numericOutput); sValues.AddRange (stringOutput); }
public static void ActionRoll (RPGObject Source, string TargetValueName, ComplexityClass Class, int Modifiaction, out CheckResult resultTyp, out int restPool) { string[] attributeNames=new string[3]; RPGObject.Skill sk; if ((sk = Source.Skills.Find (delegate(RPGObject.Skill obj) { return obj.SkillName == TargetValueName.Split ('-') [0]; })) != default(RPGObject.Skill)) { if(TargetValueName.Split('-').Length>1){ for(int i=0;i<sk.Focus.Length;i++){ } } } resultTyp = CheckResult.Succss; restPool = 0; }
//Diese Funktion überprüft ob der Sender die Anforderungen des Content erfüllt public static bool CheckContentRequirements (Content c, RPGObject Sender, bool DeepSearch) { return true; }
public static void CompetitiveRoll (RPGObject source, string sourceValueName, RPGObject Target, ComplexityClass Class, int SMod, int TMod, out CheckResult resultTypSource, out CheckResult resultTypTarget, out int restPoolTarget) { resultTypSource = CheckResult.Succss; resultTypTarget = CheckResult.Succss; restPoolTarget = 0; /* //Bestimmung des TargetValueNames und der AttributValues mithilfe der SkillHelper. string targetValueName = ""; int[] targetAttributeValues = new int[3]; int[] sourceAttributeValues = new int[3]; float mod = 0; SkillHelper sh;//With TargetValue Associated Skill bool targetStuffAssigned = false; if ((sh = skh.Find (delegate(SkillHelper obj) { return obj.Skill == sourceValueName; })) != default(SkillHelper)) { for (int i=0; i<sh.Counter.Length; i++) { mod = System.Convert.ToSingle (sh.Counter [i].Split (',') [1]); targetValueName = sh.Counter [i].Split (',') [0]; RPGObject.Skill sk; if ((sk = (Target as RPGObject).Skills.Find (delegate(RPGObject.Skill obj) {//Untersuche ob die taregtKreatur über den Skill verfügt return obj.SkillName == sh.Counter [i].Split (',') [0].Split ('-') [0]; })) != default(RPGObject.Skill)) { if (sh.Counter [i].Split (',') [0].Split ('-').Length > 1) {//Suche bei Spezialskills nach dem Fokus in der targetkreatur for (int ii=0; ii<sk.Focus.Length; ii++) { if (sk.Focus [ii] == sh.Counter [i].Split (',') [0].Split ('-') [1]) { targetAttributeValues [0] = (int)Target [sk.FocusAttributes [ii] [0]]; targetAttributeValues [1] = (int)Target [sk.FocusAttributes [ii] [1]]; targetAttributeValues [2] = (int)Target [sk.FocusAttributes [ii] [2]]; targetStuffAssigned = true; break; } } } else { //targetKreaturen bringen für den gefundenen Skill ihre eigenen Attribute mit targetAttributeValues [0] = (int)Target [sk.Attribute1]; targetAttributeValues [1] = (int)Target [sk.Attribute2]; targetAttributeValues [2] = (int)Target [sk.Attribute3]; targetStuffAssigned = true; break; } } else Debug.Log ("Skill-Gatter unvollständig:" + sh.Counter [i].Split (',') [0]); } //Im Fall das wir kein geeigneten targetSkill finden konnten nutzen wir die Standardwerte aus dem Helfer if (!targetStuffAssigned) { SkillHelper sh2;//Skill der Counterd if ((sh2 = skh.Find (delegate(SkillHelper obj) { return obj.Skill == targetValueName; })) != default(SkillHelper)) { targetAttributeValues [0] = (int)Target [sh2.associatedAttributes [0]]; targetAttributeValues [1] = (int)Target [sh2.associatedAttributes [1]]; targetAttributeValues [2] = (int)Target [sh2.associatedAttributes [2]]; targetStuffAssigned = true; } else Debug.Log ("Skill-Gatter unvollständig:" + targetValueName); } //Beschaffung der Attributsschwelle für Source RPGObject.Skill skSource; if ((skSource = source.Skills.Find (delegate(RPGObject.Skill obj) { return obj.SkillName == sourceValueName.Split (',') [0].Split ('-') [0]; })) != default(RPGObject.Skill)) { sourceAttributeValues [0] = (int)source [skSource.Attribute1]; sourceAttributeValues [1] = (int)source [skSource.Attribute2]; sourceAttributeValues [2] = (int)source [skSource.Attribute3]; if (sourceValueName.Split (',') [0].Split ('-').Length > 1) { for (int i=0; i<skSource.Focus.Length; i++) { if (sourceValueName.Split (',') [0].Split ('-') [1] == skSource.Focus [i]) { sourceAttributeValues [0] = (int)source [skSource.FocusAttributes [i] [0]]; sourceAttributeValues [1] = (int)source [skSource.FocusAttributes [i] [1]]; sourceAttributeValues [2] = (int)source [skSource.FocusAttributes [i] [2]]; } } } } else { SkillHelper shsource; if ((shsource = skh.Find (delegate(SkillHelper obj) { return obj.Skill == sourceValueName.Split (',') [0].Split ('-') [0]; })) != default(SkillHelper)) { sourceAttributeValues [0] = (int)source [shsource.associatedAttributes [0]]; sourceAttributeValues [1] = (int)source [shsource.associatedAttributes [1]]; sourceAttributeValues [2] = (int)source [shsource.associatedAttributes [2]]; } else Debug.Log ("Skill-Gatter unvollständig:" + sourceValueName); } //Beschaffung der Modifikationen, Counter und Basiswerte für Source und Target int sBV; int sEV; int tBV; int tEV; RPGObject.AttributModificationHelper.Modification[] sM; RPGObject.AttributModificationHelper.Modification[] tM; RPGObject.AttributModificationHelper.Counter[] sC; RPGObject.AttributModificationHelper.Counter[] tC; source.checkSkill (sourceValueName, out sBV, out sEV, out sM, out sC); Target.checkSkill (targetValueName, out tBV, out tEV, out tM, out tC); //Gegenrechnen der Counter und Modificatoren für die Source if (tC.Length > 0) { //Gegenrechnen von sM foreach (RPGObject.AttributModificationHelper.Counter cC in tC) { for (int i=0; i<sM.Length; i++) { if (cC.SourceTyp [0] == '§') { string helper = cC.SourceTyp.TrimStart ('§'); if (sM [i].SourceEffect.GeneralOrder < cC.Order && (sM [i].SourceEffect.GeneralCategory == helper || sM [i].SourceEffect.Tags.Contains (helper))) sM [i] = null; } else { if (sM [i].Order < cC.Order && sM [i].SourceType == cC.SourceTyp) sM [i] = null; } } } //Zusammenrechnen aller sM auf den sBV und in sEV legen. sEV = sBV; foreach (RPGObject.AttributModificationHelper.Modification cM in sM) { sEV +=(int)cM.Value; } } //Ausführung des ersten Rolls resultTypSource = RollCheck (ref sEV, SMod, (int)Class, sourceAttributeValues); if (resultTypSource >= 0) { //Wenn der erste Roll nicht scheitert, müssen wir auch noch eine Probe für das Ziel ablegen. if (sC.Length > 0) { //Gegenrechnen von tM foreach (RPGObject.AttributModificationHelper.Counter cC in sC) { for (int i=0; i<tM.Length; i++) { if (cC.SourceTyp [0] == '§') { string helper = cC.SourceTyp.TrimStart ('§'); if (tM [i].SourceEffect.GeneralOrder < cC.Order && (tM [i].SourceEffect.GeneralCategory == helper || tM [i].SourceEffect.Tags.Contains (helper))) tM [i] = null; } else { if (tM [i].Order < cC.Order && tM [i].SourceType == cC.SourceTyp) tM [i] = null; } } } //Zusammenrechnen aller tM auf den tBV und in tEV legen. tEV = tBV; foreach (RPGObject.AttributModificationHelper.Modification cM in tM) { tEV +=(int) cM.Value; } } tEV = (int)(tEV * mod); //Ausführen des zweiten Rolls resultTypTarget = RollCheck (ref tEV, TMod - sEV, (int)Class, targetAttributeValues); restPoolTarget = tEV; if ((int)resultTypTarget > (int)resultTypSource && resultTypSource >= 0) resultTypSource = CheckResult.Failure; } else { resultTypTarget = CheckResult.Succss; restPoolTarget = 0; } } else Debug.LogError ("Skill-Gatter unvollständig:" + sourceValueName); //Create Impossible Outcome resultTypSource = CheckResult.Succss; resultTypTarget = CheckResult.Succss; restPoolTarget = 0; */ }
public static void ActionRoll (RPGObject Source, string TargetValueName, ComplexityClass Class, int Modifiaction, out CheckResult resultTyp) { string[] AttributNames = new string[3]; float mod = 0f; resultTyp = CheckResult.Succss; //Bestimmung der zum Skill assoziierten Attribute /* RPGObject.Skill sk; if ((sk = (Source as RPGObject).Skills.Find (delegate(RPGObject.Skill obj) { return obj.SkillName == TargetValueName.Split ('-') [0]; })) != default(RPGObject.Skill)) { if (TargetValueName.Split ('-').Length > 1) { string[] s = TargetValueName.Split ('-'); int tryies = -1;//Wir überprüfen zunächst ob die geforderte Fokusierung vorhanden ist. for (int i=0; i<sk.Focus.Length; i++) { if (sk.Focus [i] == s [1]) { AttributNames = sk.FocusAttributes [i]; mod = 1; tryies++; } } if (tryies == -1) {//Fokus nicht Vorhanden //Krame Skill Helper Heraus um das Umrechungsverhältnis zu bestimmen SkillHelper sh; if ((sh = skh.Find (delegate(SkillHelper obj) { return obj.Skill == s [0]; })) != default(SkillHelper)) { for (int i=0; i<sh.Substitution.Length; i++) { if (sh.Substitution [i].Split (',') [0] == s [1]) { mod = System.Convert.ToSingle (sh.Substitution [i].Split (',') [1]); AttributNames [0] = sk.Attribute1; AttributNames [1] = sk.Attribute2; AttributNames [2] = sk.Attribute3; } } } else Debug.Log ("SkillHelper-Gatter Unvollständing:" + TargetValueName); } } else { //Es wird nach dem allgemeinem Wert und seinen Attributen gefragt. mod = 1; AttributNames [0] = sk.Attribute1; AttributNames [1] = sk.Attribute2; AttributNames [2] = sk.Attribute3; } } else { //Krame SkillHelper zur Bestimmung der Attribute hervor SkillHelper sh; if ((sh = skh.Find (delegate(SkillHelper obj) { return obj.Skill == TargetValueName.Split ('-') [0]; })) != default(SkillHelper)) { AttributNames = sh.associatedAttributes; } } //Beschaffung der Daten int bV = 0; int eV = 0; RPGObject.AttributModificationHelper.Modification[] m; RPGObject.AttributModificationHelper.Counter[] c; int[] AttributeValues = new int[3]; AttributeValues [0] = (int)Source [AttributNames [0]]; AttributeValues [1] = (int)Source [AttributNames [1]]; AttributeValues [2] = (int)Source [AttributNames [2]]; Source.checkSkill (TargetValueName.Split ('-') [0], out bV, out eV, out m, out c); if (eV < 0 && mod < 0) eV = (int)(eV * -mod); //Ausführen des Rolls resultTyp = RollCheck (ref eV, Modifiaction, (int)Class, AttributeValues); //Auswertung */ }
public void faceTo(RPGObject face) { faceTo(null, face); }