//attraction gun void Shoot() { RaycastHit HitInfo; if (Physics.Raycast(mainCam.transform.position, mainCam.transform.forward, out HitInfo, WeaponRange)) { //Debug.Log(HitInfo.transform.name); CompanionTarget = HitInfo.transform.GetComponent <Companion>(); if (CompanionTarget != null) { m_AttachedObject = true; m_ObjectAttached = CompanionTarget.GetComponent <Rigidbody>(); m_ObjectAttached.isKinematic = true; m_AttachingObjectStartRotation = CompanionTarget.GetComponent <Quaternion>(); } turret = HitInfo.transform.GetComponent <Turret>(); if (turret != null) { m_AttachedObject = true; m_ObjectAttached = turret.GetComponent <Rigidbody>(); m_ObjectAttached.isKinematic = true; m_AttachingObjectStartRotation = turret.GetComponent <Quaternion>(); } } }
//Create a method to check which of the two newCompanion or patient is Benificiary private static void CheckBeneficiary(Patient patient, CompanionModel newCompanion, List <Companion> existingCompanion, int?companionTypeId) { //DomainObjectRepository newDomain = new DomainObjectRepository(); //var companionTypeId = newDomain.Get<CompanionType>(ct => ct.CompanionType1 == newCompanion.CompanionType).CompanionTypeID; if (patient.IsBeneficiary == true && (patient.IsBeneficiary == newCompanion.IsBeneficiary && companionTypeId == (int)Enums.CompanionType.Primary)) { throw new PatientsMgtException(1, "error", "Creating new Companion", "The Patient is already benificiary!! " + "You can't have the companion as benificiary"); } if (patient.IsBeneficiary == false && (patient.IsBeneficiary == newCompanion.IsBeneficiary && companionTypeId == (int)Enums.CompanionType.Primary)) { throw new PatientsMgtException(1, "error", "Creating new Companion", "You need to set either the patient or the Companion as Beneficiary "); } // only one Companion asscoiated to the patient should be benificiary and not more var duplicateComp = new Companion(); duplicateComp = existingCompanion.SingleOrDefault(c => c.CompanionCID == newCompanion.CompanionCID); if (duplicateComp != null) { existingCompanion.Remove(duplicateComp); } if (newCompanion.IsBeneficiary == true && existingCompanion != null && existingCompanion.Any(comp => comp.IsBeneficiary == newCompanion.IsBeneficiary)) { throw new PatientsMgtException(1, "error", "Creating new Companion", "There is already one companion associated with the patient declared as beneficiary!!" + "\r\n Only one companion should be beneficiary"); } }
void Start() { //Create large Landscape largeMap = Map.createLandscape(20, 20); scoutingActive = false; healingActive = false; //Create tactical Map; smallMap = Map.createSmallHexa(); Map.setLookout(5); finishTile = EventFunctionCollection.GetRandomField(); Map.setFinish(finishTile); //WICHTIG DRIN BEHALTEN!!! caravanPosition = new HexaPos(0, 0); //Map.discoverAllTiles(true); //Gesamt Skalierung des Brettspiels hilfreich für die Kameraführung. Momentan skalierung 10x Initialisation.mapGO.transform.localScale = new Vector3(10, 10, 10); turn = 0; moveCaravan(new HexaPos(0, 0)); meeples = new List <Meeple>(); sandstorms = new List <Sandstorm>(); activeCompanion = null; rand = new System.Random(); activeMode = GameMode.PREPARATION; createMeeple <Hunter>("prep1", new HexaPos(2, 11), true); createMeeple <Mercenary>("prep2", new HexaPos(4, 12), true); createMeeple <Healer>("prep3", new HexaPos(5, 13), true); createMeeple <Scout>("prep4", new HexaPos(7, 14), true); createMeeple <PackAnimal>("prep5", new HexaPos(13, 12), true); createMeeple <Prince>("Prince", new HexaPos(8, 7)); }
public static void positionAndParent_Meeple(GameObject Meeple, HexaPos position) { GameObject par = GameObject.Find("MeepleCollection"); GameObject fath = new GameObject(Meeple.GetComponent <Meeple>().meepleName); fath.transform.localScale = par.transform.lossyScale; fath.transform.position = par.transform.position; Meeple.transform.localScale = par.transform.lossyScale; Meeple.transform.position = par.transform.position; Meeple.transform.localEulerAngles = new Vector3(0, 180, 0); //Meeple.transform.Translate(new Vector3(0, 0.4f, 0), Space.Self); fath.transform.parent = par.transform; Meeple.transform.parent = fath.transform; setMeeplePos(Meeple, position); Meeple mip = Meeple.GetComponent <Meeple>(); if (mip.GetType().IsSubclassOf(typeof(Companion))) { Companion c = Meeple.GetComponent <Companion>(); if (c.GetType().Name != "PackAnimal") { c.setFoodPackages_hpBar(); } } }
private void DgvList_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Insert) { Patient patient = new Patient(); ShowPatientInfoForm(patient); } else if (e.KeyCode == Keys.Delete) { if (!(CurrnetRowDataBoundItem is Patient patient)) { return; } Companion companion = new Companion() { CompanionID = patient.CompanionID, Name = patient.CompanionName, Phone = patient.PhoneNumber }; if (FormHelper.IsDeleteOrNot()) { DB.Patient.Delete(patient); DB.Companion.Delete(companion); } } }
public override void Init(Blackboard blackboard) { this.blackboard = blackboard; companion = blackboard.GetValueFromKey <Companion>("companion"); comeFromOverwatchTick = 20; tickTime = comeFromOverwatchTick; }
public override void Init(Blackboard blackboard) { this.blackboard = blackboard; companion = blackboard.GetValueFromKey <Companion>("companion"); comeFromHideTick = 7; tickTime = 0; }
public static bool Parse(SeekableReader r, out System system) { if (!Unit.Parse(r, out Unit? u)) { throw new InvalidSystemException("No core star"); } system = new System() { Core = u }; while (r.Peek() == ' ') { while (r.Peek() == ' ') // w+ { r.Read(); } if (!Companion.Parse(r, out Companion? companion) || companion == null) { throw new InvalidSystemException("Expected companion"); } system.Companions.Add(companion); } return(true); }
public void TestWeatherJSONParser() { Companion companion = new Companion(); WeatherMaker wm = new WeatherMaker(); Assert.AreEqual(-900, wm.getCurTemperatureByCityID(012)); }
public void Show(Companion companion, string message) { portrait.companion = companion; text.text = message; gameObject.SetActive(true); secondsRemaining = secondsToShow; }
private void InsertIntoCompanionHistoryTable(Companion companion) { if (companion.IsActive == false && companion.DateOut != null) { // check that the companion is not in the table with the same patient // we can have more than one history for the same companion if the patient is diffrent // var comp = _domainObjectRepository.Get<CompanionHistory>(c => c.CompanionCID == companion.CompanionCID // && c.PatientCID == companion.PatientCID); // if (comp == null) // { _domainObjectRepository.Create <CompanionHistory>(new CompanionHistory() { CompanionCID = companion.CompanionCID, DateIn = companion.DateIn, DateOut = companion.DateOut, PatientCID = companion.PatientCID, CompanionType = _domainObjectRepository.Get <CompanionType>(ct => ct.CompanionTypeID == companion.CompanionTypeID)?.CompanionType1, IsActive = companion.IsActive, CreatedDate = companion.CreatedDate, IsBeneficiary = companion.IsBeneficiary, ModifiedBy = companion.ModifiedBy, ModifiedDate = companion.ModifiedDate, Name = companion.CompanionFName + " " + companion.CompanionMName + " " + companion.CompanionLName, Notes = companion.Notes, CreatedBy = companion.CreatedBy, }); // } } }
public static bool Parse(SeekableReader r, out System system) { Unit u; if (!Unit.Parse(r, out u)) { throw new InvalidSystemException("No core star"); } system = new System(); system.Core = u; while (r.Peek() == ' ') { while (r.Peek() == ' ') // w+ { r.Read(); } Companion companion; if (!Companion.Parse(r, out companion)) { throw new InvalidSystemException("Expected companion"); } system.Companions.Add(companion); } return(true); }
public void SayCurrentWeatherInNsk() { Companion companion = new Companion(); WeatherMaker wm = new WeatherMaker(); double temperatureNsk = wm.getCurTemperatureByCityID(1496747); Assert.AreEqual(">>> Сейчас на улице: " + temperatureNsk, companion.getWords("Покажи погоду в Новосибирске")); }
public void IsCurrentWeatherCorrect() { Companion companion = new Companion(); WeatherMaker wm = new WeatherMaker(); double temperatureBarnaul = wm.getCurTemperatureByCityID(1510853); Assert.AreEqual(">>> Сейчас на улице: " + temperatureBarnaul, companion.getWords("Покажи погоду")); }
public void GetWeatherFromWrongCityID() { Companion companion = new Companion(); WeatherMaker wm = new WeatherMaker(); Assert.AreEqual(">>> Скажешь ID города?", companion.getWords("Покажи погоду по ID города")); Assert.AreEqual(">>> Упс! Кажется, города с таким ID не существует", companion.getWords("012")); }
public override void Init(Blackboard blackboard) { this.blackboard = blackboard; candidatePositions = new List <Vector3>(); companion = blackboard.GetValueFromKey <Companion>("companion"); player = companion.player; }
void Awake() { //find the gameobjects rb2d = GetComponent <Rigidbody2D>(); c = GetComponent <Companion>(); p = Player.instance(); c2d = GetComponent <Collider2D>(); }
public void IsCurrentExchRateEURCorrect() { Companion companion = new Companion(); ExchRateMaker erm = new ExchRateMaker(); double curErm = erm.getCurExchRateEUR(); Assert.AreEqual(">>> Курс евро: " + curErm, companion.getWords("Покажи курс евро")); }
private void Awake() { player = Player.instance(); comp = GameObject.Find("Companion").GetComponent <Companion>(); lastSpawn = new Enemy[spawnPoints.Length]; el = GameObject.Find("Enemies").GetComponent <EnemyList>(); op = GameObject.Find("EnemyPool").GetComponent <ObjectPooler>(); }
public void DrawConclusionsForYourself() { LastCompanion = Companion.GetComponent <Trader>().Strategy; if (LastCompanion == TraderStrategy.Fraud) { WasItCheated = true; } }
void DetachObject() { m_AttachedObject = false; m_AttachingObject = false; m_ObjectAttached.isKinematic = false; CompanionTarget = null; turret = null; canShoot = false; }
public void Clear() { dungeon = null; companion = null; branch = null; heartContainer.hearts = 0; Refresh(); }
public void PickUpItem(Companion ob) { if (!CanPickUpItem(ob.CompanionOwner)) { return; } long amount = 0; if (Account != null && Item.Info.Effect == ItemEffect.Gold && Account.GuildMember != null && Account.GuildMember.Guild.GuildTax > 0) { amount = (long)Math.Ceiling(Item.Count * Account.GuildMember.Guild.GuildTax); } ItemCheck check = new ItemCheck(Item, Item.Count - amount, Item.Flags, Item.ExpireTime); if (ob.CanGainItems(false, check)) { if (amount > 0) { Item.Count -= amount; Account.GuildMember.Guild.GuildFunds += amount; Account.GuildMember.Guild.DailyGrowth += amount; Account.GuildMember.Guild.DailyContribution += amount; Account.GuildMember.Guild.TotalContribution += amount; Account.GuildMember.DailyContribution += amount; Account.GuildMember.TotalContribution += amount; foreach (GuildMemberInfo member in Account.GuildMember.Guild.Members) { if (member.Account.Connection?.Player == null) { continue; } member.Account.Connection.Enqueue(new S.GuildMemberContribution { Index = Account.GuildMember.Index, Contribution = amount, ObserverPacket = false }); } } Item.UserTask?.Objects.Remove(this); ob.GainItem(Item); Despawn(); return; } //Get Max Carry of type //Reduce Amount by type. //Send updated floor counts //Gain New / partial items return; }
public Companion CreateCompanion(Gender gender) { Companion companion = new Companion(gender); if (gender == Gender.Male) { companion.name = RandomString(maleNames); companion.hair = RandomSprite(maleHair); companion.body = RandomSprite(bodies); companion.outfit = RandomSprite(maleOutfits); } else { companion.name = RandomString(femaleNames); companion.hair = RandomSprite(femaleHair); companion.body = RandomSprite(bodies); companion.outfit = RandomSprite(femaleOutfits); } companion.normalFace = normalFace; companion.happyFace = happyFace; companion.sadFace = sadFace; companion.attack = 0; companion.defense = 0; companion.speed = 0; var total = Player.instance.character.attack + Player.instance.character.defense + Player.instance.character.speed; int pointsToAllocate = Random.Range(total - 10, total + 11); for (int point = 0; point < pointsToAllocate; ++point) { var randomNumber = Random.Range(0.0f, 1.0f); if (randomNumber < 0.33f) { ++companion.attack; } else if (randomNumber < 0.67f) { ++companion.defense; } else { ++companion.speed; } } if (companion.attack < 3) { companion.attack = 3; } companion.skills.Add(Item.skills[Random.Range(0, Item.skills.Length)]); return(companion); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { companion = animator.GetComponent <Companion>(); companion.CompanionNavMeshAgent = animator.GetComponent <NavMeshAgent>(); companion.CompanionNavMeshAgent.speed = 16; //shouldZip = IfShouldZip(animator.transform); }
public void LevelthreeSpell(int lvl3choiceNOW) { CastSpell cast = CastSpell.FindObjectOfType <CastSpell>(); DoubleCast dCast = DoubleCast.GetComponent <DoubleCast>(); SplitCast split = SplitCast.GetComponent <SplitCast>(); Companion Corb = CompOrb.GetComponent <Companion>(); if (lvl3choiceNOW == 1) { // Multicast cast.doubleCast = dCast.doubleCast; cast.cd1Per = dCast.cooldownPercent; cast.splitCast = false; cast.damage1Per = dCast.damagePercent; cast.CompOrb = false; } if (lvl3choiceNOW == 2) { // Splitcast cast.doubleCast = false; cast.splitCast = split.splitCast; cast.cd1Per = split.cooldownPercent; cast.damage1Per = split.damagePercent; cast.CompOrb = false; } if (lvl3choiceNOW == 3) { //CompOrb cast.CompOrbCD = Corb.Cooldown; cast.CompOrbDur = Corb.duration; cast.CompOrb = Corb.CompOrb; cast.damage1Per = Corb.damagePercent; cast.cd1Per = Corb.cooldownPercent; cast.doubleCast = false; cast.splitCast = false; } if (lvl3choiceNOW == 4) { // Multicast cast.doubleCast = dCast.doubleCast; cast.cd1Per = dCast.cooldownPercent * split.cooldownPercent; cast.splitCast = true; cast.damage1Per = dCast.damagePercent * split.damagePercent; cast.CompOrb = false; } if (lvl3choiceNOW == 0) { cast.damage1Per = 1f; cast.doubleCast = false; cast.splitCast = false; cast.CompOrb = false; cast.cd1Per = 1f; } }
public override void OnGainTrigger(Entity entity) { base.OnGainTrigger(entity); Debug.Log("On Equip Trigger"); companion = new Companion(companionProto); if (entity is Player player) { companion.SetOwner(player); companion.Spawn(player.Position); } }
public PatientInfoForm() { InitializeComponent(); Patient = new Patient(); Companion = new Companion(); btnModifier.Enabled = false; btnModifier.Visible = false; btnDone.Enabled = true; btnDone.Visible = true; }
private void btnSubmit_Click(object sender, EventArgs e) { bool error = false; try { var testEmail = new System.Net.Mail.MailAddress(txt_email.Text); lbl_validation_email.Visible = false; } catch { lbl_validation_email.Visible = true; error = true; } if (txt_password.Text.Length == 0) { lbl_validation_password.Visible = true; error = true; } else { lbl_validation_password.Visible = false; } if (!error) { PluginRegistry.setStringValue("email", txt_email.Text); PluginRegistry.setStringValue("password", txt_password.Text); CookieContainer cookieContainer = new CookieContainer(); Tuple <CookieContainer, string> tAuthentication = Companion.loginToAPI(cookieContainer); this.Cookie = tAuthentication.Item1; string loginResponse = tAuthentication.Item2; Debug.Write("loginResponse: " + loginResponse); if (loginResponse == "verification" || loginResponse == "ok") { this.LoginResponse = loginResponse; this.Close(); } else { MessageBox.Show("Invalid Credentials, please re-enter them and retry"); } } else { MessageBox.Show("Invalid Credentials, please re-enter them and retry"); } }
public void AmmoAdded(Companion input) { //check to see if we have ammo if (Stats.AmmoSuppliesCount > 0) { //which companion if (input.companion1) { Stats.Companion1Ammo++; Stats.AmmoSuppliesCount--; } else if (input.companion2) { Stats.Companion2Ammo++; Stats.AmmoSuppliesCount--; } else if (input.companion3) { Stats.Companion3Ammo++; Stats.AmmoSuppliesCount--; } else if (input.companion4) { Stats.Companion4Ammo++; Stats.AmmoSuppliesCount--; } //play sound safeHouseAudioManager.PlayPlusButton(); //update observers NotifyObservers(); } else if (Stats.AmmoSuppliesCount == 0) { //which companion if (input.companion1) { StartCoroutine(ShowPrompt(AmmoAddPrompts[0])); } else if (input.companion2) { StartCoroutine(ShowPrompt(AmmoAddPrompts[1])); } else if (input.companion3) { StartCoroutine(ShowPrompt(AmmoAddPrompts[2])); } else if (input.companion4) { StartCoroutine(ShowPrompt(AmmoAddPrompts[3])); } } }
void OnTriggerStay(Collider col) { if (col.gameObject.tag == "Crate Detection") { PlayerShoot.nearbyCrate = col.gameObject.GetComponentInParent<Crate>(); } if (col.gameObject.tag == "Magic Area") { Companion = col.gameObject.GetComponentInParent<Companion>(); bNearCrystal = true; sCrystalType = Companion.gameObject.tag; } if (col.gameObject.tag == "Climable") { bCanClimb = true; } }
void OnTriggerExit(Collider col) { if (col.gameObject.tag == "Door Exit") { bDoorExited = false; } else if (col.gameObject.tag == "Door Enter") { bDoorEntered = false; } if (col.gameObject.tag == "Crate Detection") { PlayerShoot.nearbyCrate = null; } if (col.gameObject.tag == "Magic Area") { Companion = null; bNearCrystal = false; sCrystalType = null; } if (col.gameObject.tag == "Climable") { bCanClimb = false; } }
public static bool Parse(TextReader r, out Companion companion) { NearCompanion nc; if (NearCompanion.Parse(r, out nc)) { companion = nc; return true; } #if EXTENDED_SYSTEM_PARSING FarCompanion fc; if( FarCompanion.Parse( r, out fc ) ) { companion = fc; return true; } #endif companion = null; return false; }