//public static Dictionary<string,AminoAcid> ToDictionaryBy3Letter(this IList<AminoAcid> acids, bool toupper) //{ // Dictionary<string,AminoAcid> dict = new Dictionary<string,AminoAcid>(); // foreach(AminoAcid acid in acids) // { // string name3 = acid.name3; // if(toupper) name3 = name3.ToUpper(); // dict.Add(name3, acid); // } // return dict; //} //public static Dictionary<char, AminoAcid> ToDictionaryBy1Letter(this IList<AminoAcid> acids) //{ // Dictionary<char,AminoAcid> dict = new Dictionary<char, AminoAcid>(); // foreach(AminoAcid acid in acids) // dict.Add(acid.name1, acid); // return dict; //} //public static string[] HBioinfoConvertTo3Letter( params char [] resis1) { return HBioinfo.AminoAcids.Convert_1Letter_to_3Letter( resis1); } //public static char [] HBioinfoConvertTo1Letter(bool toupper, params string[] resis3) { return HBioinfo.AminoAcids.Convert_3Letter_to_1Letter(toupper, resis3); } public static IReadOnlyList <Acid> GerResAminoAcid(this Pdb.Atom atom) { string name3 = atom.resName; HDebug.Assert(name3.Length == 3); return(Acid.From3Letter(name3)); }
public void Fire() { float x = transform.parent.localScale.x; GameObject go = Instantiate(_acid, transform.position, Quaternion.identity); Acid ac = go.GetComponent <Acid>(); ac.direction = x; }
void Shoot() { anim.SetTrigger("isAttacking"); Vector2 attack = (Vector2)(player.transform.position - transform.position); GameObject acidObject = Instantiate(acidPrefab, rigidbody2d.position, Quaternion.identity); Acid acid = acidObject.GetComponent <Acid>(); acid.Shoot(attack, acidSpeed); }
protected override bool OnMove(Direction d) { if (Utility.RandomDouble() <= .5) { Acid acid = new Acid(); acid.MoveToWorld(Location, Map); Effects.PlaySound(Location, Map, Utility.RandomList(0x5D9, 0x5DB)); } return(base.OnMove(d)); }
public override void LaunchProjectile() { float distToPlayer = Vector2.Distance(this.transform.position, player.position); if (shoot == true && distToPlayer < 15) { GameObject projectileObject = Instantiate(projectilePrefab, transform.position + Vector3.down, Quaternion.identity); Acid projectile = projectileObject.GetComponent <Acid>(); projectile.Launch(Vector2.down, 400); AudioManager.Instance.Playsound(sound, 0.2f); StartCoroutine(Delay()); } }
// Use this for initialization void Start() { motor = GetComponent <CharacterMotor>(); cameraScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraScript>(); //Add Sword this.gameObject.AddComponent <Sword>(); swordClass = GetComponent <Sword>(); //Add Bomb this.gameObject.AddComponent <Bomb>(); bombClass = GetComponent <Bomb>(); //Add Acid this.gameObject.AddComponent <Acid>(); acidClass = GetComponent <Acid>(); }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); SpecialAbilities.PierceSpecialAbility(.5, this, defender, 50, 15, -1, true, "", "Their acid momentarily weakens your armor!", "-1"); Acid acid = new Acid(); acid.MoveToWorld(defender.Location, Map); Effects.PlaySound(defender.Location, Map, Utility.RandomList(0x22F)); int acidAmount = Utility.RandomMinMax(1, 3); for (int a = 0; a < acidAmount; a++) { Acid extraAcid = new Acid(); extraAcid.MoveToWorld(new Point3D(defender.X + Utility.RandomMinMax(-1, 1), defender.Y + Utility.RandomMinMax(-1, 1), defender.Z), Map); } }
private void CreateAcid() { var level = _getLevel(); for (var x = -1; x < 2; x++) { for (var y = -1; y < 2; y++) { if (x == 0 || y == 0) { var posX = x + PositionX; var posY = y + PositionY; if (IsLevelCellValid(posX, posY, level.Width, level.Height) && WillReplace) { level[posX, posY] = new Acid(posX, posY, _getLevel, _changePlayerHp, _acidGameLoopAction); } } } } }
// Use this for initialization void Start() { motor = GetComponent<CharacterMotor>(); cameraScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraScript>(); //Add Sword this.gameObject.AddComponent<Sword>(); swordClass = GetComponent<Sword>(); //Add Bomb this.gameObject.AddComponent<Bomb>(); bombClass = GetComponent<Bomb>(); //Add Acid this.gameObject.AddComponent<Acid>(); acidClass = GetComponent<Acid>(); }
//====================================================== #region Event Methods private void SpecialForm_Load(object sender, EventArgs e) { //Until I find a better way, this list is typed manually. //Rules attached to this ability should be added first, for editing. if (ability.SpecialRules != null) { foreach (SpecialRule rule in ability.SpecialRules) { clbSpecials.Items.Add(rule, true); } } //Add the rest of the rules, but don't add ones already added from the ability. SpecialRule nRule = new Acid(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new ArmorBuster(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Blast(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Blind(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new ChangeSpeed(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new ChangeStrength(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new ChangeMarksmanship(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new ChangeTech(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new CounterAttack(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Deafen(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new DrainTime(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Encase(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Explosion(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Fear(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new GreaterAcid(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new GreaterCounterAttack(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new GreaterIndirect(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new GreaterNoDeflect(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new GreaterNoDodge(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Heal(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new IdentifyFriendFoe(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Indirect(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Leap(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new NoArmorReduction(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new NoDeflect(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new NoDodge(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Paralyze(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new PoisonMalignant(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new PoisonResilient(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Pull(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Range(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new CharacterCreator.Classes.SpecialRules.Radius(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new RerollMisses(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new RerollHits(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Reach(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Roll(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Slam(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Stream(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Stun(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new SuperbAcid(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new SuperbCounterAttack(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new SuperbIndirect(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new SuperbNoDeflect(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new SuperbNoDodge(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new TechAttack(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new TechBlast(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new TechBlind(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new TechDeafen(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new TechExplosion(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new TechEncase(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new TechMelee(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new TechParalyze(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new TechRange(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Teleport(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Throw(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } nRule = new Trip(); if (!ability.SpecialRules.Contains(nRule)) { clbSpecials.Items.Add(nRule); } }