public void RemoveTimer(CooldownTimer timer) { if (list.Contains(timer)) { list.Remove(timer); } }
protected override void StateEnter_ShotsShotsShots() { shotTimer = new CooldownTimer(shotsShotsTime.Evaluate()); consecutiveCharges = 0; consecutiveSpins = 0; bossChannels.doAttack = "ShotsShots"; }
public void Start() { mCooldownTimer = new CooldownTimer(this.CooldownTime); var hook = GlobalObjectsUtility.FromStateHook <BaseStateHook>(); hook.GameMessageRouter.AddListener(Common.Messaging.GameChannel, this); }
private void SetCooldowns() { rocketCooldown = BaseRocketTimer - difficultyLevel / 3 - Random.Range(0, BaseRocketTimer / 2); spawningEnemyCooldown = new CooldownTimer(SpawnCooldown, StartSpawnCooldown); spawningRocketCooldown = new CooldownTimer(rocketCooldown); }
private void Start() { rb = GetComponent <Rigidbody>(); timer = new CooldownTimer(5); timer.TimerCompleteEvent += TimerOnTimerCompleteEvent; }
protected override void Start() { base.Start(); fireTimer = new CooldownTimer(fireCooldown); clip = new Magazine(clipSize, reloadTime); }
void Awake() { bm = FindObjectOfType <BossManager>(); GameObject LaserBar = GameObject.Find("LaserBar"); laserCD = LaserBar.GetComponent <CooldownTimer>(); }
void Start() { Register(); attackCooldown = new CooldownTimer(attackDelay); rb = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); }
private void AddTimer(CooldownType type, float second, TimerEventHandler action) { CooldownTimer t = TimerManager.SharedInstance.CreateTimer(second, action); timerDict.Add(type, t); String name = this.gameObject.name; Type tt = this.baseSoldier.GetType(); // if (tt == typeof(ODSoldier) || // tt == typeof(HMSoldier) || // tt == typeof(LESoldier) || // tt == typeof(MXSoldier)) { // t.Start(); // } // // if (name=="hf1"||name=="hf2"||name=="hf3"||name=="hf1") { // // } // // // if (this.gameObject.name == "hf2") { // t.Start (); // } // if (this.gameObject.name == "hf3") { // t.Start (); // } // if (this.gameObject.name == "hf1") { // t.Start (); // } t.Start(); }
public Actor(int level, string name, float x, float y, float width, float height, float scale, Direction heading, int hitPoints) { float ellipseX = x + ((width * scale) / 2); float ellipseY = y + (height * scale); _level = level; _name = name; _x = x; _y = y; _width = (width * scale); _height = (height * scale); _boundingBox = new CollisionBox(_x, _y, _width, _height); // TODO: Implement _collisionBox as the actual bounds for collision checks. // This will allow _boundingBox to serve other purposes than collision resolution. //_collisionBox = new CollisionBox(x, y, width, height, scale); _primEllipse = new PrimEllipse(ellipseX, (ellipseY - 4), 24, 10, Color.Gold, 1, 0); _hitPoints = hitPoints; _previousHitPoints = _hitPoints; _maxHitPoints = _hitPoints; _heading = heading; _alive = true; _hitPointsFillFactor = _hitPoints / _maxHitPoints; _hitPointsTimer = new CooldownTimer(REGEN_DELAY); _combatExitTimer = new CooldownTimer(COMBAT_DELAY); _takingDamage = false; }
protected override void Start() { base.Start(); shootCooldownTimer = new CooldownTimer(shootCooldown); shootDurTimer = new ExpirationTimer(shootDur); }
internal override void Update(int x, int y) { if (cooldown == null) { cooldown = new CooldownTimer(30); } BoundedFloat buffer = new BoundedFloat(0, 0, cost); CachePowerLevels(); if (powerinL + powerinR + powerinD + powerinU >= buffer.max) { BoundedFloat.MoveVals(ref powerinL, ref buffer, powerinL); BoundedFloat.MoveVals(ref powerinR, ref buffer, powerinR); BoundedFloat.MoveVals(ref powerinD, ref buffer, powerinD); BoundedFloat.MoveVals(ref powerinU, ref buffer, powerinU); } EmptyInputs(); if (buffer.IsFull()) { state = true; var pos = new Vector2(x - range, y - range); var size = new Vector2(2 * range, 2 * range); var entities = EntityManager.GetEntitiesAt(pos, size, e => !(e is AutoDart || e is Player || e.data.invulnerable)); if (cooldown.Ready()) { if (entities.Length > 0) { cooldown.Reset(); var e = entities[MathUtil.RandInt(Program.Rand, 0, entities.Length - 1)]; var darvel = e.data.pos - new Vector2(x, y); darvel = darvel.Normalize(); var dartpos = new Vector2(x, y); dartpos += 1.5f * darvel; darvel /= 10; var ad = new AutoDart(dartpos, darvel); if (!ad.IsCollidingWithTerrain()) { EntityManager.AddEntity(ad); } } else { cooldown.SetTime(-100); } } } else { state = false; } Terrain.TileAt(x, y).enumId = state ? TileID.AutoShooterOn : TileID.AutoShooterOff; }
public static void StartTimer(float duration, TimerCallback callback, GameObject currentObject) { CooldownTimer timer = currentObject.AddComponent <CooldownTimer>(); timer.timeLeft = duration; timer.callback = callback; }
//=====================================================================================================================// //================================================= Public Properties ==================================================// //=====================================================================================================================// #region Public Properties #endregion //=====================================================================================================================// //============================================= Unity Callback Methods ================================================// //=====================================================================================================================// #region Unity Callback Methods private void Start() { _transform = transform; _turnAngle = 0f; _bumpCooldown = new CooldownTimer(_data._bumpCooldownTime, false); _bCanBump = true; }
// Use this for initialization void Start() { material = GetComponent <Renderer>().material; if (framerate > 0 && textures?.Length > 1) { changeTimer = new CooldownTimer(1.0f / framerate); } }
public Fireball() { _rank = 1; _castTime = 1.5f; _timer = new CooldownTimer(_castTime); _manaCost = 10.0f; // TODO: change to 7% base mana _damage = 27; }
public Shooter(Vector2 position, int shootCooldown, int projlife) : base(EntityID.Shooter, position) { data.speed = 0; data.jumppower = 0; data.life = new BoundedFloat(50, 0, 50); this.shootCooldown = new CooldownTimer(shootCooldown); this.projlife = projlife; }
public virtual void Awake() { useTimer = new CooldownTimer(cooldown); useTimer.Clear(); player = GetComponent <Player>(); actualCooldown = new UpgradableValue <float>(cooldown, cooldown * 0.7f, Upgrade.generalCooldowns); }
private void Start() { startPos = transform.position; SetPlayerStats(); StartCoroutine(BecomeInvulnerable()); shootingCooldown = new CooldownTimer(fireRate); }
void Start() { trigger = GetComponent <EventTrigger>(); EventTriggerHelper.AddEvent(trigger, EventTriggerType.PointerDown, Shield); shieldCD = GetComponent <CooldownTimer>(); audioSrc = GetComponent <AudioSource>(); shipHitbox = playerShip.GetComponent <Collider2D>(); bg_ready = transform.GetChild(1).GetComponent <Image>(); }
protected override void OnControllerEnabled() { base.OnControllerEnabled(); maxTransitionsPerUpdate = 1; shotTimer = new CooldownTimer(shotsShotsTime.Evaluate()); animator = GetComponentInChildren <Animator>(); bossChannels = channels as MohawkBossChannels; player = GameObject.FindGameObjectWithTag("Player").transform; }
protected override void StateEnter_Chase() { if (bossChannels != null) { bossChannels.doAttack = "Crawl"; } endAnimationFlag = false; giveUpChase = new CooldownTimer(giveUpChaseTime.Evaluate()); }
void Start() { shootTimer = new CooldownTimer(1.0f / fireRate, startCooldown); if (magazineReload > 0) { magazine = new Magazine(magazineSize, magazineReload); } }
protected override void OnControllerEnabled() { base.OnControllerEnabled(); boatThrowTimer = new CooldownTimer(boatThrowInterval); chargeTimer = new CooldownTimer(chargeTime); giveUpChase = new CooldownTimer(giveUpTime); sproutBoats = new CooldownTimer(sproutTime); }
protected override void OnRemovedFromInventory() { // Deactivate Item Deactivate(); // Stop Cooldown Timer CooldownTimer.SetActive(false); CooldownTimer.Reset(); }
protected override void Awake() { base.Awake(); // Init Cooldown Timer CooldownTimer.SetTick(gameObject); InitEvents(); }
public Squisher(Vector2 position) : base(EntityID.Squisher, position) { trackTimer = new CooldownTimer(20); dmgTimer = new CooldownTimer(50); data.speed = 0; data.jumppower = 0; data.airResis = 0.99f; data.life = new BoundedFloat(50, 0, 50); }
// Use this for initialization protected override void Start() { base.Start(); brain = GetComponent <Brain>(); motor = GetComponent <CharacterMotor>(); dashTimer = new CooldownTimer(dashCooldown); dashInvulnTimer = new ExpirationTimer(dashInvuln); dashExpTimer = new ExpirationTimer(dashDuration); }
public CooldownTimer CreateTimer(float second,TimerEventHandler action) { //Debug.Log("CreateTimer"); CooldownTimer cooldownTimer = new CooldownTimer (second); cooldownTimer.Tick = action; AddTimer (cooldownTimer); return cooldownTimer; }
public static void AddTimer(Mobile caster, TimeSpan ts) { if (Instance == null) { Instance = new CooldownTimer(); Instance.Start(); } Instance.ExpireTable[caster] = DateTime.UtcNow + ts; }
private void Jump(bool ignoreCheckingIfOnGround = false) { if (this.IsGrounded() || ignoreCheckingIfOnGround && this.hasJumped == false) { this.hasJumped = true; this.rb.AddForce(new Vector3(0.0f, jumpHeight, 0.0f) * speed); CooldownTimer.StartTimer(0.2f, JumpCooldown); this.RenderBallAfterPowerup(); } }
// Use this for initialization void Start() { startPosition = transform.position; dropDelay = new CooldownTimer(delayTime, false); respawnTimer = new CooldownTimer(respawnTime, false); hitInfo = new RaycastHit(); objWidth = renderer.bounds.size; //Simple method of deciding whether to detect up or down. Could be enum, but prob overkill. lookDown = detectDown ? -1 : 1; }
// Use this for initialization void Start() { leftShootTimer = new CooldownTimer(shootDelay); pool = new ObjectPooler(); pool.InitPool("bullets", bulletPrefab, 5, true); pool.InitPool("bb", bulletPrefab, 5, false); //p2.InitPool("bb", bulletPrefab, 5, false); shootCooldown = shootTimer + shootDelay; }
// Use this for initialization void Start() { cd = new CooldownTimer(cooldown, true); }
public void RemoveTimer(CooldownTimer timer) { if (list.Contains (timer)) { list.Remove (timer); } }
public void AddTimer(CooldownTimer timer) { list.Add (timer); }
// Use this for initialization void Start() { attackSound = gameObject.transform.Find("rayOrigin").GetComponent<AudioSource>(); attackSound.volume = 0.8f; attackSound.Stop(); attackVFX = gameObject.transform.Find("character/Attack_VFX").GetComponent<ParticleSystem>(); attackVFX.playOnAwake = false; blockVFX = gameObject.transform.Find("character/Block").GetComponent<ParticleSystem>(); blockVFX.playOnAwake = false; pi = gameObject.GetComponent<PlayerInfo>(); //Gets this players PlayerInfo script information. cc = gameObject.GetComponent<CharacterController>(); //Gets this players CharacterController information animator = transform.Find("character").GetComponent<Animator>(); attackCD = new CooldownTimer (attackCoolDown, true); //creates a cooldown for the attack. counterCD = new CooldownTimer (counterCoolDown); //creates a cooldown for the counter counterDur = new CooldownTimer (counterDuration, true); counterCD.forceCooldownOver(); }