protected override void ReadAttribute(string key, string value) { switch (key) { case "Region": this.Region = (SkillRegionType)value.ToInt32(); break; case "Affect": this.Affect = (AffectType)value.ToInt32(); break; case "LifeTime": this.LifeTime = value.ToFloat(); break; case "MaxCount": this.MaxCount = value.ToInt32(); break; case "JudgeName": this.JudgeName = value; break; } }
public CG_Group(String inName, Boolean inContainer, Boolean inSubdivision, int inVisibility, int inSelectability) { this.Name = inName; this.Container = inContainer; this.Subdivision = inSubdivision; this.Visibility = ToAffectType(inVisibility); this.Selectability = ToAffectType(inVisibility); }
public Affect(AffectType type, int duration, int value, string target, Dictionary<ContagionVector, int> afflictionChances) { Type = type; Duration = duration; Value = value; Target = target; AfflictionChances = afflictionChances; }
public void Setup(IActionReceiver other) { var pref = other as RailShot; width = pref.width; affectType = pref.affectType; damage = pref.damage; }
public void Setup(IActionReceiver other) { var pref = other as AreaDamage; affectType = pref.affectType; radius = pref.radius; damage = pref.damage; force = pref.force; }
public Vector2 GetValueMulti(AffectType type) { Vector2 value = Vector2.zero; foreach (var a in affectLists[(int)type].List) { value += a.GetValueMulti(); } return(value); }
public Vector2Int GetValueAdd(AffectType type) { Vector2Int value = Vector2Int.zero; foreach (var a in affectLists[(int)type].List) { value += a.GetValueAdd(); } return(value); }
public void Setup(IActionReceiver other) { var pref = other as AreaBuff; radius = pref.radius; affectType = pref.affectType; modifiers = new PropertyModifier[pref.modifiers.Length]; for (int i = 0; i < pref.modifiers.Length; i++) { modifiers[i] = pref.modifiers[i].Clone(); } }
public CG_Group(SerializationInfo info, StreamingContext ctxt) { //Get the values from info and assign them to the appropriate properties mName = (string)info.GetValue("Name", typeof(string)); mAccessName = (string)info.GetValue("AccessName", typeof(string)); mDesc = (string)info.GetValue("Desc", typeof(string)); mContainer = (bool)info.GetValue("Container", typeof(bool)); mSubdivision = (bool)info.GetValue("Subdivision", typeof(bool)); mVisibility = (AffectType)info.GetValue("Visibility", typeof(AffectType)); mSelectability = (AffectType)info.GetValue("Selectability", typeof(AffectType)); }
public List <ActorBase> GetActorsByAffectType(AffectType type) { switch (type) { case AffectType.Ally: return(GetAllAlly()); case AffectType.Host: if (m_Host == null) { return(null); } else { return(new List <ActorBase>() { m_Host }); } case AffectType.Enem: return(GetAllEnemy()); case AffectType.Boss: List <ActorBase> list = new List <ActorBase>(); List <ActorBase> enemys = GetAllEnemy(); for (int i = 0; i < enemys.Count; i++) { ActorEnemy monster = enemys[i] as ActorEnemy; if (monster != null && monster.ActorType == ActorType.Monster) { if (monster.IsBoss()) { list.Add(monster); } } } return(list); case AffectType.Self: return(new List <ActorBase>() { this }); case AffectType.Each: return(GameEntry.Level.GetAllRoleActor()); default: return(new List <ActorBase>()); } }
/// <summary> /// Default constructor. /// </summary> public Affect() { ++_count; _modifiers = new List <AffectApplyType>(); _value = String.Empty; _type = AffectType.spell; _duration = 0; _level = 0; foreach (int bv in _bitVectors) { _bitVectors[bv] = 0; } }
/// <summary> /// Constructor that takes a spell argument to create an affect and set its paramters. /// </summary> /// <param name="type"></param> /// <param name="name"></param> /// <param name="duration"></param> /// <param name="location"></param> /// <param name="modifier"></param> /// <param name="bitvector"></param> public Affect(AffectType type, string name, int duration, Apply location, int modifier, Bitvector bitvector) { _modifiers = new List <AffectApplyType>(); _value = name; _type = type; _duration = duration; AffectApplyType apply = new AffectApplyType(); apply.Amount = modifier; apply.Location = location; _modifiers.Add(apply); SetBitvector(bitvector); }
protected override void ReadAttribute(string key, string value) { switch (key) { case "Affect": this.Affect = (AffectType)value.ToInt32(); break; case "BuffID": this.BuffID = value.ToInt32(); break; case "Ratio": this.Ratio = value.ToFloat(); break; } }
public AffectType ToAffectType(int AffectString) { AffectType AffectRslt = new AffectType(); switch (AffectString) { case 1: AffectRslt = AffectType.False; break; case 2: AffectRslt = AffectType.True; break; default: AffectRslt = AffectType.NoEffect; break; } return(AffectRslt); }
void OnGUI() { if (omSkin == null) { omSkin = Resources.Load ("ObjectMaster") as GUISkin; } scroll = GUILayout.BeginScrollView (scroll); GUI.skin = omSkin; GUILayout.Label ("ObjectMaster 1.4.2"); #region General collapseGeneral = EditorGUILayout.Foldout(collapseGeneral, "General"); if (collapseGeneral) { GUILayout.BeginVertical("Box"); GUILayout.Label("Generic Tools"); if (GUILayout.Button ("Group")) { Utilities.Group (); } if (GUILayout.Button ("Unparent")) { Utilities.Unparent (); } if (GUILayout.Button ("Ground")) { Utilities.Ground (); } GUILayout.BeginHorizontal(); if (GUILayout.Button ("Join Nearby")) { Utilities.ChangeBuddy (stickRadius); Utilities.Buddy (); } stickRadius = EditorGUILayout.FloatField (stickRadius); GUILayout.EndHorizontal(); if (GUILayout.Button ("Wrap in GameObject")) { Utilities.WrapObject (); } if (GUILayout.Button ("Bring Near / View")) { Utilities.BringNear (); } GUILayout.BeginHorizontal(); if (GUILayout.Button ("Round To Int")) { switch (roundAffect) { case AffectType.Transform: Utilities.Snap (); break; case AffectType.Position: Utilities.SnapPosition (); break; case AffectType.Rotation: Utilities.SnapRotation (); break; case AffectType.Scale: Utilities.SnapScale (); break; } } roundAffect = (AffectType)EditorGUILayout.EnumPopup (roundAffect); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button ("Zero Values")) { switch (zeroAffect) { case AffectType.Transform: Utilities.ZeroAllTransforms (); break; case AffectType.Position: Utilities.ZeroPosition (); break; case AffectType.Rotation: Utilities.ZeroRotation (); break; case AffectType.Scale: Utilities.ResetScale (); break; } } zeroAffect = (AffectType)EditorGUILayout.EnumPopup (zeroAffect); GUILayout.EndHorizontal(); GUILayout.EndVertical (); } #endregion #region Clipboard collapseClipboard = EditorGUILayout.Foldout(collapseClipboard, "Attribute Clipboard"); if (collapseClipboard) { // BRING CLOSER GUILayout.BeginVertical ("Box"); GUILayout.Label("Copy and Paste Attributes"); if (Utilities.localCoords) { localGlobal = "Use Local Coords"; } else { localGlobal = "Use Global Coords"; } if (GUILayout.Button (localGlobal)) { Utilities.ToggleLocalGlobal (); } clipAffect = (AffectType)EditorGUILayout.EnumPopup (clipAffect); GUILayout.BeginHorizontal (); if (GUILayout.Button ("Copy")) { switch (clipAffect) { case AffectType.Transform: Utilities.CopyTransforms (); break; case AffectType.Position: Utilities.CopyPosition (); break; case AffectType.Rotation: Utilities.CopyRotation (); break; case AffectType.Scale: Utilities.CopyScale (); break; } } if (GUILayout.Button ("Paste")) { switch (clipAffect) { case AffectType.Transform: Utilities.PasteTransforms (); break; case AffectType.Position: Utilities.PastePosition (); break; case AffectType.Rotation: Utilities.PasteRotation (); break; case AffectType.Scale: Utilities.PasteScale (); break; } } GUILayout.EndHorizontal (); GUILayout.EndVertical (); } #endregion #region NameReplace collapseFindReplace = EditorGUILayout.Foldout(collapseFindReplace, "Naming and Replacing"); if (collapseFindReplace) { GUILayout.BeginVertical ("Box"); GUILayout.Label("Naming and Replacing"); if (GUILayout.Button("Find & Replace Names")) { // Get existing open window or if none, make a new one: FindReplaceNames window = (FindReplaceNames)EditorWindow.GetWindow(typeof(FindReplaceNames)); #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5_0 window.title = "Replace Names"; #else window.titleContent = new GUIContent ("Replace Names"); #endif window.Show(); } if (GUILayout.Button("Find & Replace Objects")) { // Get existing open window or if none, make a new one: FindReplaceObjects window = (FindReplaceObjects)EditorWindow.GetWindow(typeof(FindReplaceObjects)); #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5_0 window.title = "Replace Objects"; #else window.titleContent = new GUIContent ("Replace Objects"); #endif window.Show(); } if (GUILayout.Button("Rename Master")) { // Get existing open window or if none, make a new one: RenameMaster window = (RenameMaster)EditorWindow.GetWindow(typeof(RenameMaster)); #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5_0 window.title = "Rename"; #else window.titleContent = new GUIContent ("Rename"); #endif window.Show(); } GUILayout.EndVertical(); } #endregion #region Random collapseRandomize = EditorGUILayout.Foldout(collapseRandomize, "Randomize"); if (collapseRandomize) { GUILayout.BeginVertical("Box"); GUILayout.Label("Random Rotation or Scale"); GUILayout.BeginHorizontal(); GUILayout.Label("X"); useX = EditorGUILayout.Toggle(useX); GUILayout.Label("Y"); useY = EditorGUILayout.Toggle(useY); GUILayout.Label("Z"); useZ = EditorGUILayout.Toggle(useZ); GUILayout.EndHorizontal(); if (GUILayout.Button("Rotation")) { if (useX) {Utilities.RotateRandomX();} if (useY) {Utilities.RotateRandomY();} if (useZ) {Utilities.RotateRandomZ();} } if (GUILayout.Button("Scale")) { Utilities.minScale = minScale; Utilities.maxScale = maxScale; Vector3 scaleRandoms = Vector3.one; if (useX) { scaleRandoms.x = 1; } else { scaleRandoms.x = 0; } if (useY) { scaleRandoms.y = 1; } else { scaleRandoms.y = 0; } if (useZ) { scaleRandoms.z = 1; } else { scaleRandoms.z = 0; } Utilities.ScaleRandomEditor(scaleRandoms); } minScale = EditorGUILayout.FloatField("Min:", minScale); maxScale = EditorGUILayout.FloatField("Max:", maxScale); GUILayout.EndVertical(); } #endregion #region TurnObjects collapseSpin = EditorGUILayout.Foldout(collapseSpin, "Turn Objects"); if (collapseSpin) { GUILayout.BeginVertical("Box"); GUILayout.Label("Turn Object on Axis"); turnAmount = EditorGUILayout.FloatField("Degrees:", turnAmount); GUILayout.BeginHorizontal (); if (GUILayout.Button ("X")) { Utilities.Rotate(new Vector3(turnAmount,0,0)); } if (GUILayout.Button ("Y")) { Utilities.Rotate(new Vector3(0,turnAmount,0)); } if (GUILayout.Button ("Z")) { Utilities.Rotate(new Vector3(0,0,turnAmount)); } GUILayout.EndHorizontal (); GUILayout.EndVertical (); } #endregion #region Scatter collapseScatter = EditorGUILayout.Foldout(collapseScatter, "Scatter Objects"); if (collapseScatter) { GUILayout.BeginVertical("Box"); GUILayout.Label("Scatter Selected Objects"); howScatter = (ScatterType)EditorGUILayout.EnumPopup(howScatter); scatter = EditorGUILayout.FloatField ("Radius:", scatter); if (GUILayout.Button("Scatter")) { Utilities.ChangeScatter(scatter); if (howScatter == ScatterType.IntoCircle) { Utilities.ScatterCircle(); } else if (howScatter == ScatterType.IntoCube) { Utilities.ScatterCube(); } else if (howScatter == ScatterType.IntoSphere) { Utilities.ScatterSphere(); } else if (howScatter == ScatterType.IntoSquare) { Utilities.ScatterSquare(); } } GUILayout.EndVertical (); } #endregion #region Links collapseLinks = EditorGUILayout.Foldout(collapseLinks, "Links"); if (collapseLinks) { GUILayout.BeginVertical("Box"); GUILayout.Label("Links"); GUILayout.BeginHorizontal (); if (GUILayout.Button ("Store Page")) { Application.OpenURL("http://bit.ly/1jxh6Uo"); } if (GUILayout.Button ("Website")) { Application.OpenURL("http://bit.ly/1W0XrrN"); } GUILayout.EndHorizontal (); GUILayout.BeginHorizontal (); if (GUILayout.Button ("Forum")) { Application.OpenURL("http://bit.ly/1NkqN27"); } if (GUILayout.Button ("Intro Video")) { Application.OpenURL("http://bit.ly/1GP9bq9"); } GUILayout.EndHorizontal (); GUILayout.EndVertical(); } #endregion GUILayout.EndScrollView (); }
/// <summary> /// Default constructor. /// </summary> public Affect() { ++_count; _modifiers = new List<AffectApplyType>(); _value = String.Empty; _type = AffectType.spell; _duration = 0; _level = 0; foreach( int bv in _bitVectors ) { _bitVectors[ bv ] = 0; } }
/// <summary> /// Constructor that takes a spell argument to create an affect and set its paramters. /// </summary> /// <param name="type"></param> /// <param name="name"></param> /// <param name="duration"></param> /// <param name="location"></param> /// <param name="modifier"></param> /// <param name="bitvector"></param> public Affect(AffectType type, string name, int duration, Apply location, int modifier, Bitvector bitvector) { _modifiers = new List<AffectApplyType>(); _value = name; _type = type; _duration = duration; AffectApplyType apply = new AffectApplyType(); apply.Amount = modifier; apply.Location = location; _modifiers.Add(apply); SetBitvector(bitvector); }
void OnGUI() { if (omSkin == null) { omSkin = Resources.Load("ObjectMaster") as GUISkin; } scroll = GUILayout.BeginScrollView(scroll); GUI.skin = omSkin; GUILayout.Label("ObjectMaster 1.4.2"); #region General collapseGeneral = EditorGUILayout.Foldout(collapseGeneral, "General"); if (collapseGeneral) { GUILayout.BeginVertical("Box"); GUILayout.Label("Generic Tools"); if (GUILayout.Button("Group")) { Utilities.Group(); } if (GUILayout.Button("Unparent")) { Utilities.Unparent(); } if (GUILayout.Button("Ground")) { Utilities.Ground(); } GUILayout.BeginHorizontal(); if (GUILayout.Button("Join Nearby")) { Utilities.ChangeBuddy(stickRadius); Utilities.Buddy(); } stickRadius = EditorGUILayout.FloatField(stickRadius); GUILayout.EndHorizontal(); if (GUILayout.Button("Wrap in GameObject")) { Utilities.WrapObject(); } if (GUILayout.Button("Bring Near / View")) { Utilities.BringNear(); } GUILayout.BeginHorizontal(); if (GUILayout.Button("Round To Int")) { switch (roundAffect) { case AffectType.Transform: Utilities.Snap(); break; case AffectType.Position: Utilities.SnapPosition(); break; case AffectType.Rotation: Utilities.SnapRotation(); break; case AffectType.Scale: Utilities.SnapScale(); break; } } roundAffect = (AffectType)EditorGUILayout.EnumPopup(roundAffect); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Zero Values")) { switch (zeroAffect) { case AffectType.Transform: Utilities.ZeroAllTransforms(); break; case AffectType.Position: Utilities.ZeroPosition(); break; case AffectType.Rotation: Utilities.ZeroRotation(); break; case AffectType.Scale: Utilities.ResetScale(); break; } } zeroAffect = (AffectType)EditorGUILayout.EnumPopup(zeroAffect); GUILayout.EndHorizontal(); GUILayout.EndVertical(); } #endregion #region Clipboard collapseClipboard = EditorGUILayout.Foldout(collapseClipboard, "Attribute Clipboard"); if (collapseClipboard) { // BRING CLOSER GUILayout.BeginVertical("Box"); GUILayout.Label("Copy and Paste Attributes"); if (Utilities.localCoords) { localGlobal = "Use Local Coords"; } else { localGlobal = "Use Global Coords"; } if (GUILayout.Button(localGlobal)) { Utilities.ToggleLocalGlobal(); } clipAffect = (AffectType)EditorGUILayout.EnumPopup(clipAffect); GUILayout.BeginHorizontal(); if (GUILayout.Button("Copy")) { switch (clipAffect) { case AffectType.Transform: Utilities.CopyTransforms(); break; case AffectType.Position: Utilities.CopyPosition(); break; case AffectType.Rotation: Utilities.CopyRotation(); break; case AffectType.Scale: Utilities.CopyScale(); break; } } if (GUILayout.Button("Paste")) { switch (clipAffect) { case AffectType.Transform: Utilities.PasteTransforms(); break; case AffectType.Position: Utilities.PastePosition(); break; case AffectType.Rotation: Utilities.PasteRotation(); break; case AffectType.Scale: Utilities.PasteScale(); break; } } GUILayout.EndHorizontal(); GUILayout.EndVertical(); } #endregion #region NameReplace collapseFindReplace = EditorGUILayout.Foldout(collapseFindReplace, "Naming and Replacing"); if (collapseFindReplace) { GUILayout.BeginVertical("Box"); GUILayout.Label("Naming and Replacing"); if (GUILayout.Button("Find & Replace Names")) { // Get existing open window or if none, make a new one: FindReplaceNames window = (FindReplaceNames)EditorWindow.GetWindow(typeof(FindReplaceNames)); #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5_0 window.title = "Replace Names"; #else window.titleContent = new GUIContent("Replace Names"); #endif window.Show(); } if (GUILayout.Button("Find & Replace Objects")) { // Get existing open window or if none, make a new one: FindReplaceObjects window = (FindReplaceObjects)EditorWindow.GetWindow(typeof(FindReplaceObjects)); #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5_0 window.title = "Replace Objects"; #else window.titleContent = new GUIContent("Replace Objects"); #endif window.Show(); } if (GUILayout.Button("Rename Master")) { // Get existing open window or if none, make a new one: RenameMaster window = (RenameMaster)EditorWindow.GetWindow(typeof(RenameMaster)); #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5_0 window.title = "Rename"; #else window.titleContent = new GUIContent("Rename"); #endif window.Show(); } GUILayout.EndVertical(); } #endregion #region Random collapseRandomize = EditorGUILayout.Foldout(collapseRandomize, "Randomize"); if (collapseRandomize) { GUILayout.BeginVertical("Box"); GUILayout.Label("Random Rotation or Scale"); GUILayout.BeginHorizontal(); GUILayout.Label("X"); useX = EditorGUILayout.Toggle(useX); GUILayout.Label("Y"); useY = EditorGUILayout.Toggle(useY); GUILayout.Label("Z"); useZ = EditorGUILayout.Toggle(useZ); GUILayout.EndHorizontal(); if (GUILayout.Button("Rotation")) { if (useX) { Utilities.RotateRandomX(); } if (useY) { Utilities.RotateRandomY(); } if (useZ) { Utilities.RotateRandomZ(); } } if (GUILayout.Button("Scale")) { Utilities.minScale = minScale; Utilities.maxScale = maxScale; Vector3 scaleRandoms = Vector3.one; if (useX) { scaleRandoms.x = 1; } else { scaleRandoms.x = 0; } if (useY) { scaleRandoms.y = 1; } else { scaleRandoms.y = 0; } if (useZ) { scaleRandoms.z = 1; } else { scaleRandoms.z = 0; } Utilities.ScaleRandomEditor(scaleRandoms); } minScale = EditorGUILayout.FloatField("Min:", minScale); maxScale = EditorGUILayout.FloatField("Max:", maxScale); GUILayout.EndVertical(); } #endregion #region TurnObjects collapseSpin = EditorGUILayout.Foldout(collapseSpin, "Turn Objects"); if (collapseSpin) { GUILayout.BeginVertical("Box"); GUILayout.Label("Turn Object on Axis"); turnAmount = EditorGUILayout.FloatField("Degrees:", turnAmount); GUILayout.BeginHorizontal(); if (GUILayout.Button("X")) { Utilities.Rotate(new Vector3(turnAmount, 0, 0)); } if (GUILayout.Button("Y")) { Utilities.Rotate(new Vector3(0, turnAmount, 0)); } if (GUILayout.Button("Z")) { Utilities.Rotate(new Vector3(0, 0, turnAmount)); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); } #endregion #region Scatter collapseScatter = EditorGUILayout.Foldout(collapseScatter, "Scatter Objects"); if (collapseScatter) { GUILayout.BeginVertical("Box"); GUILayout.Label("Scatter Selected Objects"); howScatter = (ScatterType)EditorGUILayout.EnumPopup(howScatter); scatter = EditorGUILayout.FloatField("Radius:", scatter); if (GUILayout.Button("Scatter")) { Utilities.ChangeScatter(scatter); if (howScatter == ScatterType.IntoCircle) { Utilities.ScatterCircle(); } else if (howScatter == ScatterType.IntoCube) { Utilities.ScatterCube(); } else if (howScatter == ScatterType.IntoSphere) { Utilities.ScatterSphere(); } else if (howScatter == ScatterType.IntoSquare) { Utilities.ScatterSquare(); } } GUILayout.EndVertical(); } #endregion #region Links collapseLinks = EditorGUILayout.Foldout(collapseLinks, "Links"); if (collapseLinks) { GUILayout.BeginVertical("Box"); GUILayout.Label("Links"); GUILayout.BeginHorizontal(); if (GUILayout.Button("Store Page")) { Application.OpenURL("http://bit.ly/1jxh6Uo"); } if (GUILayout.Button("Website")) { Application.OpenURL("http://bit.ly/1W0XrrN"); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Forum")) { Application.OpenURL("http://bit.ly/1NkqN27"); } if (GUILayout.Button("Intro Video")) { Application.OpenURL("http://bit.ly/1GP9bq9"); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); } #endregion GUILayout.EndScrollView(); }
public ControlAffectInfo(Control control, AffectType affectType) { this.control = control; this.affectType = affectType; }