private void setCurrentDragonIndex(DragonType dragontype) { //disable the dragon buttons dragonbuttongroup.SetActive(false); mastergamerunner.setCurrentDragonIndex(dragontype); }
public void ProvidesDamageBasedOnEnergyType() { var sorcerer = CharacterTestTemplates.Sorcerer(); var dragonType = new DragonType(); dragonType.EnergyType = "cold"; dragonType.BreathRange = 30; dragonType.BreathShape = "cone"; var draconic = new Mock <IDraconicBloodline>(); draconic.Setup(x => x.DragonType).Returns(dragonType); sorcerer.Add(draconic.Object); sorcerer.SetLevel(10); var breath = new BreathWeapon(); sorcerer.Add(breath); Assert.Equal("10d6", breath.Damage.ToString()); Assert.Equal(15, breath.SaveDC); sorcerer.AbilityScores.SetScore(AbilityScoreTypes.Charisma, 16); Assert.Equal(18, breath.SaveDC); Assert.Equal(1, breath.UsesPerDay); Assert.Equal("Breath Weapon (30' cone, 10d6 cold, DC 18, 1/day)", breath.DisplayString()); }
// Use this for initialization void Start() { dragonType = GetComponentInParent <DragonType>(); thisDragon = dragonType.DragonTypeV; audioSource = GetComponent <AudioSource>(); stepSource = transform.parent.GetComponent <AudioSource>(); }
private static PlayersDragon getPlayerDragon(string data) { data = data.Trim(); DragonType dragtype = DragonType.SEADRAGON; uint count = 0; string util = ""; data += ' '; foreach (char ch in data) { switch (ch) { case '-': util = util.Trim(); dragtype = (DragonType)(uint)int.Parse(util); util = ""; break; case ' ': util = util.Trim(); count = (uint)int.Parse(util); util = ""; break; default: util += ch; break; } } return(new PlayersDragon(dragtype, count)); }
private static void ReadDragon() { string[] input = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (input.Length != 5) { return; } if (dragonTypes.Any(t => t.Type == input[0])) { DragonType currentType = dragonTypes.Where(t => t.Type == input[0]).FirstOrDefault(); if (currentType.Dragons.Any(d => d.Name == input[1])) { Dragon currentDragon = currentType.Dragons.Where(d => d.Name == input[1]).FirstOrDefault(); currentDragon.Damage = int.Parse(input[2]); currentDragon.Health = int.Parse(input[3]); currentDragon.Armor = int.Parse(input[4]); } else { currentType.Dragons.Add(new Dragon(input[1], input[2], input[3], input[4])); } } else { dragonTypes.Add(new DragonType() { Type = input[0], Dragons = new List <Dragon>() { new Dragon(input[1], input[2], input[3], input[4]) } }); } }
// Use this for initialization void Awake() { //defines animator anim = GetComponentInChildren <Animator>(); playerRigidBody = GetComponent <Rigidbody2D>(); tm = GameObject.FindGameObjectWithTag("Tiles").GetComponent <Tilemap>(); dragonType = GetComponent <DragonType>(); canMove = true; }
public void startCallDragonTimer(DragonType dragonType, long startTime, long endTime) { TimerTask task = new TimerTask(startTime, endTime, 1, ThreadType.MainThread); long leftTime = endTime - startTime; leftTime = leftTime <= 0 ? 0 : leftTime; if (leftTime > 0 && leftTime < 5) { leftTime = 10; } if (dragonType == DragonType.EarthDragon) { task.taskId = TaskID.CallEarthDragonTimer; this.callEarthDragonTime = leftTime; if (callDragonTimerEvent != null) { callDragonTimerEvent(DragonType.EarthDragon, this.callEarthDragonTime); } } else if (dragonType == DragonType.NMKXDragon) { task.taskId = TaskID.CallNMKXDragonTimer; this.callNMKXDragonTime = leftTime; if (callDragonTimerEvent != null) { callDragonTimerEvent(DragonType.NMKXDragon, this.callNMKXDragonTime); } } task.onEventEnd = callDragonTimeCompleted; task.onEvent = (TimerTask t) => { if (task.taskId == TaskID.CallEarthDragonTimer) { this.callEarthDragonTime = t.leftTime; if (callDragonTimerEvent != null) { callDragonTimerEvent(DragonType.EarthDragon, this.callEarthDragonTime); } } else if (task.taskId == TaskID.CallNMKXDragonTimer) { this.callNMKXDragonTime = t.leftTime; if (callDragonTimerEvent != null) { callDragonTimerEvent(DragonType.NMKXDragon, this.callNMKXDragonTime); } } }; task.DispatchToRealHandler(); }
public DragonType Check(DragonType p1, DragonType p2) { if (p1 == Symbols.DragonType.Bool && p2 == Symbols.DragonType.Bool) { return(Symbols.DragonType.Bool); } else { return(null); } }
public static string GetDragonName(DragonType dragonType) { DragonSaveView dSave = GetDragonSaveByDragonType(dragonType); if (dSave != null) { return(GetDragonSaveByDragonType(dragonType).dragonName); } return(string.Empty); }
public void callDragonRequest(DragonType currentDragonType) { HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.CALL_DRAGON, new CallDragonParam(Core.Data.playerManager.PlayerID, ((int)currentDragonType + 1))); task.afterCompleted += CallDragonCompleted; task.ErrorOccured += CallDragonError; //then you should dispatch to a real handler task.DispatchToRealHandler(); }
public static bool IsDragonUnlocked(DragonType dragonType) { foreach (DragonSaveView dragonSave in GameSave.SavedData.openedDragons) { if (dragonType == dragonSave.dragonType) { return(true); } } return(false); }
public static DragonSaveView GetDragonSaveByDragonType(DragonType dragonType) { foreach (DragonSaveView dragonSave in GameSave.SavedData.openedDragons) { if (dragonType == dragonSave.dragonType) { return(dragonSave); } } return(null); }
public PowerOfWyrmsTests() { sorcerer = CharacterTestTemplates.Sorcerer(); power = new PowerOfWyrms(); var draconicBloodline = new Mock <IDraconicBloodline>(); var dragonType = new DragonType(); dragonType.EnergyType = "electricity"; draconicBloodline.Setup(x => x.DragonType).Returns(dragonType); sorcerer.Add(draconicBloodline.Object); sorcerer.Add(power); }
public DragonResistancesTests() { sorcerer = CharacterTestTemplates.Sorcerer(); var dragonType = new DragonType(); dragonType.EnergyType = "cold"; var mockBloodline = new Mock <IDraconicBloodline>(); mockBloodline.Setup(x => x.DragonType).Returns(dragonType); sorcerer.Add(mockBloodline.Object); resistances = new DragonResistances(); sorcerer.Add(resistances); }
public new DragonType Check(DragonType p1, DragonType p2) { if (p1 is Symbols.DragonArray || p2 is Symbols.DragonArray) { return(null); } else if (p1 == p2) { return(Symbols.DragonType.Bool); } else { return(null); } }
public void AddsDamageForDamageTypeOfDragon() { var sorcerer = CharacterTestTemplates.Sorcerer(); var mockDraconic = new Mock <IDraconicBloodline>(); var dragonType = new DragonType(); dragonType.EnergyType = "acid"; mockDraconic.Setup(x => x.DragonType).Returns(dragonType); sorcerer.Add(mockDraconic.Object); var arcana = new DraconicArcana(); sorcerer.Add(arcana); Assert.Equal("acid spells deal +1 damage per die", arcana.BonusAbility); }
public DragonType Check(DragonType p1, DragonType p2) { if (DragonType.IsNumeric(p1) && DragonType.IsNumeric(p2)) { return(p2); } else if (p1 == DragonType.Bool && p2 == DragonType.Bool) { return(p2); } else { return(null); } }
public static System.Type TertiaryGeneType(this DragonType type) { if ((int)type == 17) { return(typeof(GaolerTertGene)); } if ((int)type == 18) { return(typeof(BanescaleTertGene)); } if ((int)type == 19) { return(typeof(VeilspunTertGene)); } return(typeof(TertiaryGene)); }
public void DraconicBloodlineDoesBonusDamageOfType() { var sorcerer = CharacterTestTemplates.Sorcerer(); var draconic = new Mock <IDraconicBloodline>(); var dragonType = new DragonType(); dragonType.EnergyType = "cold"; draconic.Setup(x => x.DragonType).Returns(dragonType); sorcerer.Add(draconic.Object); var claws = new Claws(); sorcerer.Add(claws); sorcerer.SetLevel(11); Assert.Contains("1d6 cold", claws.DisplayString()); }
public static System.Type SecondaryGeneType(this DragonType type) { if ((int)type == 17) { return(typeof(GaolerWingGene)); } if ((int)type == 18) { return(typeof(BanescaleWingGene)); } if ((int)type == 19) { return(typeof(VeilspunWingGene)); } return(typeof(WingGene)); }
public static System.Type PrimaryGeneType(this DragonType type) { if ((int)type == 17) { return(typeof(GaolerBodyGene)); } if ((int)type == 18) { return(typeof(BanescaleBodyGene)); } if ((int)type == 19) { return(typeof(VeilspunBodyGene)); } return(typeof(BodyGene)); }
public static bool IsAncientBreed(this DragonType type) { if ((int)type == 17) { return(true); } if ((int)type == 18) { return(true); } if ((int)type == 19) { return(true); } return(false); }
//get the respective dragon's attrib object as per the dragon choice index public Dragon getDragonObject(DragonType dragontype) { switch (dragontype) { case DragonType.BAHEMUTDRAGON: return(new BahemutDragon()); case DragonType.SPEEDSTERDRAGON: return(new SpeedSterDragon()); case DragonType.SEADRAGON: return(new SeaDragon()); case DragonType.TIGERDRAGON: return(new TigerDragon()); } return(null); }
public Dragon_GameController deployDragon(GameObject dragonprefab, DragonType dtype, Vector3 pos) { Dragon dragonattrib = getDragonObject(dtype); //instantiate dragon prefab GameObject dragon = GameObject.Instantiate(dragonprefab); dragon.GetComponent <Dragon_GameController> ().setDragonAttribs(dragonattrib); //set the transform Transform tf = dragon.transform; tf.position = pos; //return the newly ceated dragon's dragon_controller object return(dragon.GetComponent <Dragon_GameController>()); }
//copy constructor public Dragon(Dragon dragondata) { if (dragondata == null) { return; } this.maxhealth = dragondata.maxhealth; this.defense = dragondata.defense; this.attack = dragondata.attack; this.dragontype = dragondata.dragontype; this.movementfredom = dragondata.movementfredom; this.moves = new List <Attack> (); for (int z = 0; z < dragondata.moves.Count; z++) { this.moves.Add(dragondata.moves [z]); } }
public DragonType Check(DragonType p1, DragonType p2) { if (p1 is DragonArray || p2 is DragonArray) { return(null); } else if (p1 == p2) { return(p2); } else if (DragonType.IsNumeric(p1) && DragonType.IsNumeric(p2)) { return(p2); } else { return(null); } }
public static void SetDragonName(DragonType dragonType, string dragonName) { GetDragonSaveByDragonType(dragonType).dragonName = dragonName; GameSave.Save(GameSave.SavedData); }
/// <summary>Получить дракона по типу</summary> public static Dragon GetDragonByType(DragonType dragonType) { return(AllDragons[(int)dragonType]); }
/// <summary>Открывает нового дракона по типу и сохраняет</summary> public static void OpenNewDragon(DragonType newDragonType) { GameSave.SavedData.openedDragons.Add(new DragonSaveView(newDragonType)); GameSave.Save(GameSave.SavedData); }
public static GameObject GetBallPrefabByDragonType(DragonType dType) { return(GetDragonByType(dType).ballPrefab); }