Inheritance: MonoBehaviour
Beispiel #1
0
 public Spawn(string children, int maxChildren = 5, double initialSpawn = 0.5, Cooldown coolDown = new Cooldown())
 {
     this.children = (short)XmlDatas.IdToType[children];
     this.maxChildren = maxChildren;
     this.initialSpawn = (int)(maxChildren * initialSpawn);
     this.coolDown = coolDown.Normalize(0);
 }
 public Taunt(string[] states, Cooldown cooldown, params string[] text)
 {
     this.text = text;
     this.cooldown = cooldown;
     this.states = states;
     checkForStates = true;
 }
 public SpecificHeal(double range, int amount, string group, Cooldown coolDown = new Cooldown())
 {
     this.range = (float)range;
     this.amount = amount;
     this.group = group;
     this.coolDown = coolDown.Normalize();
 }
    // Use this for initialization
    void Start()
    {
        _bubble = GetComponent<Bubble>();
        _cooldown = new Cooldown();

        _cooldown.StartTimer(cooldownTime);
    }
Beispiel #5
0
 public Reproduce(string children = null, double densityRadius = 10, int densityMax = 5, Cooldown coolDown = new Cooldown())
 {
     this.children = children == null ? null : (short?)XmlDatas.IdToType[children];
     this.densityRadius = densityRadius;
     this.densityMax = densityMax;
     this.coolDown = coolDown.Normalize(60000);
 }
Beispiel #6
0
 public Taunt(double probability, bool broadcast, Cooldown cooldown, params string[] text)
 {
     this.text = text;
     this.probability = (float)probability;
     this.broadcast = broadcast;
     this.cooldown = cooldown;
 }
        public static ComposedWeapon composeWeapon(Cooldown cooldown,
		                                           FirePattern firePattern,
		                                           Actuation triggerHandler,
		                                           GameObject shot)
        {
            return new canonInstance(cooldown, firePattern, triggerHandler, shot);
        }
 public Reproduce(string children = null, double densityRadius = 10, int densityMax = 5, Cooldown coolDown = new Cooldown())
 {
     this.children = children == null ? null : (ushort?)BehaviorDb.InitGameData.IdToObjectType[children];
     this.densityRadius = densityRadius;
     this.densityMax = densityMax;
     this.coolDown = coolDown.Normalize(60000);
 }
 public Spawn(string children, int maxChildren = 5, double initialSpawn = 0.5, Cooldown coolDown = new Cooldown())
 {
     this.children = BehaviorDb.InitGameData.IdToObjectType[children];
     this.maxChildren = maxChildren;
     this.initialSpawn = (int) (maxChildren*initialSpawn);
     this.coolDown = coolDown.Normalize(0);
 }
Beispiel #10
0
 void Start()
 {
     _cooldown = new Cooldown();
     _cooldown.StartTimer(startTime);
     _secondsLeft = (int)startTime;
     _enable = true;
 }
Beispiel #11
0
        public Ability()
        {
            Name = "!!! Unnamed Ability !!!";
            Description = "";

            Animations = new List<GraphicsEffectDefinition>();
            CastingAnimations = new List<GraphicsEffectDefinition>();
            ImpactAnimations = new List<GraphicsEffectDefinition>();

            Damage = new Damage();
            Healing = new Damage();
            DamageType = DamageTypes.SingleTarget;
            TargettingType = TargettingTypes.Hostile;
            Cooldown = new Cooldown(0f);
            Range = new Range(20f);
            Area = 1f;
            ThreatModifier = 1f;
            AurasApplied = new List<Aura>();
            Duration = 1;

            CanMiss = true;
            CanBeDodged = true;
            CanCrit = true;
            CanBeBlocked = true;
        }
Beispiel #12
0
    public void IgnoreCollision(Collider2D other)
    {
        Physics2D.IgnoreCollision(gameObject.GetComponent<Collider2D>(), other);

        Cooldown cooldown = new Cooldown();
        cooldown.StartTimer(cooldownTimeIgnore);
        _cooldownIgnore.Add(new Eppy.Tuple<Cooldown, Collider2D>(cooldown, other));
    }
 public InvisiToss(string child, double range = 5, double? angle = null,
     Cooldown coolDown = new Cooldown(), int coolDownOffset = 0)
 {
     this.child = BehaviorDb.InitGameData.IdToObjectType[child];
     this.range = range;
     this.angle = angle*Math.PI/180;
     this.coolDown = coolDown.Normalize();
     this.coolDownOffset = coolDownOffset;
 }
Beispiel #14
0
 public Follow(double speed, double acquireRange = 10, double range = 6,
     int duration = 0, Cooldown coolDown = new Cooldown())
 {
     this.speed = (float) speed;
     this.acquireRange = (float) acquireRange;
     this.range = (float) range;
     this.duration = duration;
     this.coolDown = coolDown.Normalize(duration == 0 ? 0 : 1000);
 }
Beispiel #15
0
 public SpawnGroup(string group, int maxChildren = 5, double initialSpawn = 0.5, Cooldown coolDown = new Cooldown())
 {
     this.children = XmlDatas.ObjectDescs.Values
         .Where(x => x.Group == group)
         .Select(x => x.ObjectType).ToArray();
     this.maxChildren = maxChildren;
     this.initialSpawn = (int)(maxChildren * initialSpawn);
     this.coolDown = coolDown.Normalize(0);
 }
Beispiel #16
0
 public Grenade(double radius, int damage, double range = 5,
     double? fixedAngle = null, Cooldown coolDown = new Cooldown())
 {
     this.radius = (float) radius;
     this.damage = damage;
     this.range = range;
     this.fixedAngle = fixedAngle*Math.PI/180;
     this.coolDown = coolDown.Normalize();
 }
Beispiel #17
0
 public TossObject(string child, double range = 5, double? angle = null,
     Cooldown coolDown = new Cooldown(), int coolDownOffset = 0)
 {
     this.child = XmlDatas.IdToType[child];
     this.range = range;
     this.angle = angle * Math.PI / 180;
     this.coolDown = coolDown.Normalize();
     this.coolDownOffset = coolDownOffset;
 }
Beispiel #18
0
        public void WhenAddingCooldownToRegistry_ThenRegistryCountIncreasesByOne()
        {
            var cooldownToAdd = new Cooldown("arbitraryId", DateTime.MinValue);

            var preCount = _registry.Count;

            _registry.Add(cooldownToAdd);
            var postCount = _registry.Count;

            Assert.AreEqual(preCount + 1, postCount);
        }
Beispiel #19
0
 public CubeEntity(CubeEntity original)
 {
     GO               = original.GO;
     id               = original.id;
     position         = new Vector3(original.position.x, original.position.y, original.position.z);
     rotation         = new Quaternion(original.rotation.x, original.rotation.y, original.rotation.z, original.rotation.w);
     port             = original.port;
     points           = original.points;
     shootingCooldown = original.shootingCooldown;
     uiManager        = original.uiManager;
 }
Beispiel #20
0
 public DamageOverTime(GameObject obj) : base()
 {
     healthComponent = obj.GetComponent <Health>();
     if (healthComponent == null)
     {
         isMissingComponents = true;
         return;
     }
     nextTick      = new Cooldown(0);
     this.tickRate = 0f;
 }
Beispiel #21
0
    public bool endCooldown(string name)
    {
        Cooldown cd = findCooldown(name);

        if (cd != null)
        {
            cd.duration = 0f;
            return(true);
        }
        return(false);
    }
Beispiel #22
0
        /// <summary>
        /// Creating and invoking a start for the cooldown
        /// </summary>
        /// <param name="cooldown">Cooldown</param>
        /// <exception cref="ArgumentException">Cooldown is null</exception>
        public void CreateCooldown(Cooldown cooldown)
        {
            if (cooldown == null)
            {
                Out.QuickLog("Something went wrong with creating cooldown", LogKeys.ERROR_LOG);
                throw new ArgumentException("Cannot add cooldown, Cooldown is null, error in manager");
            }

            ServerController.Get <CooldownController>().AddCooldown(cooldown);
            cooldown.Start();
        }
 public TossObject(string child, double range = 5, double?angle                    = null,
                   Cooldown coolDown          = new Cooldown(), int coolDownOffset = 0, bool randomToss = false, bool throwProjectileEffect = true) //Enabled particles by putting to false
 {
     this.child                 = BehaviorDb.InitGameData.IdToObjectType[child];
     this.range                 = range;
     this.angle                 = angle * Math.PI / 180;
     this.coolDown              = coolDown.Normalize();
     this.coolDownOffset        = coolDownOffset;
     this.randomToss            = randomToss;
     this.throwProjectileEffect = throwProjectileEffect;
 }
Beispiel #24
0
        private void SoftTimerElapsed(string id, Cooldown.SoftCooldown softCooldown)
        {
            Cooldown cooldown = cooldownDict[id];

            softCooldown.CooldownTimer.Dispose();
            cooldown.softCooldowns.Remove(softCooldown);
            if (cooldown.softCooldowns.Count == 0)
            {
                cooldownDict.Remove(id);
            }
        }
    public Cooldown[] GetAttachmentCooldowns()
    {
        Cooldown[] cooldowns = new Cooldown[_attachments.Length];

        for (int i = 0; i < _attachments.Length; i++)
        {
            cooldowns[i] = _attachments[i].GetCooldown();
        }

        return(cooldowns);
    }
Beispiel #26
0
    void Start()
    {
        coolDown = Cooldown.m_instance;

        m_animator = GetComponent <Animator>();

        if (GetComponent <MovePlayer>() != null)
        {
            movePlayer = GetComponent <MovePlayer>();
        }
    }
        internal void Add(Cooldown cooldown)
        {
            var index = Collection.FindIndex(x => x.SteamId == cooldown.SteamId);

            if (index != -1)
            {
                return;
            }
            Collection.Add(cooldown);
            Json_DataStore.Save(Collection);
        }
Beispiel #28
0
 public Taunt(
     string[] states,
     Cooldown cooldown,
     params string[] text
     )
 {
     this.text      = text;
     this.cooldown  = cooldown;
     this.states    = states;
     checkForStates = true;
 }
    void Start()
    {
        spawnLeftCooldown = new Cooldown(initialSpawnTime);
        spawnLeftCooldown.startCooldown();
        spawnRightCooldown = new Cooldown(initialSpawnTime);
        spawnRightCooldown.startCooldown();

        colorPrefabs.Add(Colors.Blue, bluePrefab);
        colorPrefabs.Add(Colors.Green, greenPrefab);
        colorPrefabs.Add(Colors.Red, redPrefab);
        colorPrefabs.Add(Colors.Orange, orangePrefab);
    }
Beispiel #30
0
 public bool CheckIfCooldownExists(string effectName)
 {
     for (int i = 0; i < cooldowns.Count; i++)
     {
         Cooldown cd = cooldowns[i];
         if (cd.effectName == effectName)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #31
0
 private void UnbindFromAbilities()
 {
     foreach (Ability ability in owner.Abilities)
     {
         Cooldown cooldown = ability.GetComponent <Cooldown>();
         if (cooldown == null)
         {
             continue;
         }
         cooldown.RemoveModifier(this);
     }
 }
    /// <summary>
    /// The coroutine to wait for the cooldown to finish.
    /// </summary>
    /// <param name="start">The time, in seconds, that the cooldown began.</param>
    /// <param name="length">The length, in seconds, of the cooldown period.</param>
    /// <returns></returns>
    protected IEnumerator ReloadRoutine(float start, float length)
    {
        _reloading = new Cooldown(start, length);
        do
        {
            yield return(_reloading.WaitFor(0.5f));

            Debug.Log("Reloading Tick");
        } while (_reloading.Tick(Time.time));

        _reloading = null;
    }
Beispiel #33
0
 public Grenade(double radius, int damage, double range = 5,
                double?fixedAngle = null, Cooldown coolDown = new Cooldown(), ConditionEffectIndex effect = 0, int effectDuration = 0, uint color = 0xffff0000)
 {
     this.radius         = (float)radius;
     this.damage         = damage;
     this.range          = range;
     this.fixedAngle     = fixedAngle * Math.PI / 180;
     this.coolDown       = coolDown.Normalize();
     this.effect         = effect;
     this.effectDuration = effectDuration;
     this.color          = color;
 }
Beispiel #34
0
 public Taunt(
     double probability,
     bool broadcast,
     Cooldown cooldown,
     params string[] text
     )
 {
     this.text        = text;
     this.probability = (float)probability;
     this.broadcast   = broadcast;
     this.cooldown    = cooldown;
 }
 private void Start()
 {
     shootingCooldown     = new Cooldown(0.75f);
     canRotate            = true;
     playable             = true;
     bulletData           = new BulletData();
     bulletData.position  = new Position();
     bulletData.direction = new Position();
     particle             = bulletSpawnPoint.gameObject.GetComponent <ParticleSystem>();
     rigidbody            = GetComponent <Rigidbody>();
     audioSource          = GetComponent <AudioSource>();
 }
Beispiel #36
0
 public Heal(
     double range,
     int amount,
     string group      = null,
     Cooldown coolDown = new Cooldown()
     )
 {
     this.range    = (float)range;
     this.amount   = amount;
     this.group    = group;
     this.coolDown = coolDown.Normalize();
 }
    /// <summary>
    /// The coroutine to wait for the cooldown to finish.
    /// </summary>
    /// <param name="start">The time, in seconds, that the cooldown began.</param>
    /// <param name="length">The length, in seconds, of the cooldown period.</param>
    /// <returns></returns>
    protected IEnumerator CooldownRoutine(float start, float length)
    {
        _cooldown = new Cooldown(start, length);
        do
        {
            yield return(_cooldown.WaitFor(0.5f));

            Debug.Log("Cooldown Tick");
        } while (_cooldown.Tick(Time.time));

        _cooldown = null;
    }
    void Start()
    {
        SceneManager.OnDie += Respawn;

        playerMove = this;

        coolDown = GetComponent <Cooldown>();

        m_animator  = GetComponent <Animator>();
        m_transform = transform;
        m_rigidbody = rigidbody2D;
    }
Beispiel #39
0
    // Start is called before the first frame update
    void Start()
    {
        canLose = new Cooldown(5f);
        canLose.Start();

        createMap = GetComponent <CreateMap>();

        pause = GetComponent <PauseController>();
        score = GetComponent <Score>();

        playerMovement = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>();
    }
Beispiel #40
0
 public SetAltTexture(
     int minValue,
     int maxValue      = -1,
     Cooldown cooldown = new Cooldown(),
     bool loop         = false
     )
 {
     _indexMin = minValue;
     _indexMax = maxValue;
     _cooldown = cooldown.Normalize(0);
     _loop     = loop;
 }
 public NexusHealHp(
     double range,
     int amount,
     Cooldown coolDown = new Cooldown(),
     uint color        = 0xffffffff
     )
 {
     this.range    = (float)range;
     this.amount   = amount;
     this.color    = color;
     this.coolDown = coolDown.Normalize();
 }
Beispiel #42
0
 private void UpdateCooldowns()
 {
     if (cooldowns.Count > 0)
     {
         float deltaTime = Time.deltaTime;
         for (int i = 0; i < cooldowns.Count; i++)
         {
             Cooldown cd = cooldowns[i];
             cd.UpdateCooldown(deltaTime, this);
         }
     }
 }
Beispiel #43
0
 public override void OnFirstUpdate(GameTime gameTime, GameObject gameObject)
 {
     base.OnFirstUpdate(gameTime, gameObject);
     if (!string.IsNullOrEmpty(OnEvent))
     {
         EventBroker.SubscribeOnce(OnEvent, Commit);
     }
     if (TimeoutMs.HasValue)
     {
         timeoutCooldown = new Cooldown(TimeoutMs.Value);
     }
 }
Beispiel #44
0
 public Spawn(
     string children,
     int maxChildren     = 5,
     double initialSpawn = 0.5,
     Cooldown coolDown   = new Cooldown()
     )
 {
     this.children     = BehaviorDb.InitGameData.IdToObjectType[children];
     this.maxChildren  = maxChildren;
     this.initialSpawn = (int)(maxChildren * initialSpawn);
     this.coolDown     = coolDown.Normalize(0);
 }
Beispiel #45
0
    IEnumerator Start()
    {
        while (Singleton.player == null)
        {
            yield return(null);
        }

        lifePlayer     = LifePlayer.m_instance;
        cooldownPlayer = Cooldown.m_instance;

        ready = true;
    }
Beispiel #46
0
        public override void DoAction(ActionType Type, bool Dead, ref bool Acted)
        {
            if (Type != ActionType.PRIMARY ||
                !IsLocalPlayer() || IsActive || !Cooldown.IsReady())
            {
                return;
            }

            ExtraNetwork.Send(CustomRPC.PsychicEffect);
            EnableAura();
            Acted = true;
        }
Beispiel #47
0
 private void BindToAbilities()
 {
     foreach (Ability ability in owner.Abilities)
     {
         Cooldown cooldown = ability.GetComponent <Cooldown>();
         if (cooldown == null)
         {
             continue;
         }
         cooldown.AddModifier(this);
     }
 }
Beispiel #48
0
 public ShieldBlock()
 {
     Name = "Shield Block";
     Description = "Reduces damage taken by 20% for 10 seconds.";
     Range = new Range(0);
     DamageType = DamageTypes.SingleTarget;
     Duration = 0.5f;
     Cooldown = new Cooldown(20);
     TargettingType = TargettingTypes.Self;
     AurasApplied.Add(new Aura { Name = "Shield Block", Duration = 10, Statistics = { new DamageTaken(0.8f) } });
     CanMiss = false;
     CanBeDodged = false;
 }
Beispiel #49
0
    public Collectible(Vector2 pos)
    {
        cooldownSpawn = new Cooldown(0.2f);
        cooldownSplash = new Cooldown();
        position = pos;
        screenPosition = new Vector2();
        screenPosition.x = position.x * Game.width;
        screenPosition.y = position.y * Game.height;
        color = ColorHSV.GetRandomColor();
        size = Grid.cellSize * 2f;
        collisionRadius = size / 4f * Game.height;
        isHitted = false;

        AddSprite();
    }
Beispiel #50
0
	void Start() {
		NameLabel.GetComponent<Text> ().text = "Jammy";

		Progress = CooldownProgress.GetComponent<Cooldown> ();

		_attrs.Base ["hp_lost"] = 0;
		_attrs.Base ["hp_max"] = MaxHP;
		_attrs.Base ["mp_lost"] = 0;
		_attrs.Base ["mp_max"] = MaxMP;
		_attrs.Base ["str"] = 3;
		_attrs.Base ["int"] = 5;

		updateBars ();

		enemy = GameObject.Find("Enemy");

	}
 public Shoot(double radius, int count = 1, double? shootAngle = null,
     int projectileIndex = 0, double? fixedAngle = null,
     double angleOffset = 0, double? defaultAngle = null,
     double predictive = 0, int coolDownOffset = 0,
     Cooldown coolDown = new Cooldown())
 {
     this.radius = radius;
     this.count = count;
     this.shootAngle = count == 1 ? 0 : (shootAngle ?? 360.0/count)*Math.PI/180;
     this.fixedAngle = fixedAngle*Math.PI/180;
     this.angleOffset = angleOffset*Math.PI/180;
     this.defaultAngle = defaultAngle*Math.PI/180;
     this.projectileIndex = projectileIndex;
     this.predictive = predictive;
     this.coolDownOffset = coolDownOffset;
     this.coolDown = coolDown.Normalize();
 }
Beispiel #52
0
    public override void InitInternal() {
        slotPool = Pool.CreatePool(slotSample);

        pickStun = new Cooldown(0.05f);

        itemTracker = new ItemListShallowTracker(
            setList: (v) => items = v,
            getList: () => items
        );
        new ValueTracker<Item>(
            setValue: (v) => selected = v,
            getValue: () => selected
        );
        new ListShallowTracker<Poolable>(
            setList: (v) => slotPool.pool = v,
            getList: () => slotPool.pool
        );
        new ValueTracker<Action>(v => onChanged = v, () => onChanged);
        new ValueTracker<Action>(v => onSkipAnimation = v, () => onSkipAnimation);

        inventoryArea.transform.SetParent(Player.instance.inventoryAreas, worldPositionStays: false);
        inventoryArea.transform.localPosition = new Vector3(0, 100 * Unit.all.IndexOf(unit), 0);
    }
 void resetCD(string cd)
 {
     cooldowns[cd] = new Cooldown(cooldowns[cd].max, cooldowns[cd].max);
 }
Beispiel #54
0
    void Start()
    {
        // REFERENCING THE COMPONENTS

        _rigidbody = GetComponent<Rigidbody2D>();
        _renderer = GetComponent<SpriteRenderer>();

        _animator = GetComponent<Animator>();
        _text = GameObject.Find("Text").GetComponent<Text>();
        _atkCd = gameObject.AddComponent<Cooldown>(); _atkCd.Length = 1f;

        // INITIALIZING VARIABLES DEPENDENT FROM OTHERS

        _health = _maxHealth;
    }
Beispiel #55
0
 void Start()
 {
     possessCooldown = new Cooldown(0.25f);
      possessCooldown.getTime = () => TimeManager.RealTime;
      var startUnit = FindObjectOfType<StartUnit>();
      if (startUnit != null) {
          Debug.Log("startUnit.unit = " + startUnit.unit);
          Possess(startUnit.unit, animate: false);
      } else {
          Debug.Log("Possess Some Unit");
          Possess(FindObjectOfType<Unit>(), animate: false);
      }
      new ValueTracker<Unit>(v => current = v, () => current);
 }
 void TickCooldowns()
 {
     foreach (string key in new List<string>(cooldowns.Keys))
     {
         float val = cooldowns[key].current;
         val -= Time.deltaTime;
         if (val < 0)
         {
             val = 0;
         }
         cooldowns[key] = new Cooldown(cooldowns[key].max, val);
     }
 }
Beispiel #57
0
 public Charge(double speed = 4, float range = 10, Cooldown coolDown = new Cooldown())
 {
     this.speed = (float)speed;
     this.range = (float)range;
     this.coolDown = coolDown.Normalize(2000);
 }
    // Use this for initialization
    void Start()
    {
        audioSource = GetComponent<AudioSource> ();
        x5MultiplierCooldown = new Cooldown (x5MultiplierCooldownAmount);
        comboCompleteCooldown = new Cooldown (comboCompleteCooldownAmount);

        boxes.Add(transform.GetChild (0));
        boxes.Add(transform.GetChild (1));
        boxes.Add(transform.GetChild (2));
        boxes.Add(transform.GetChild (3));
        boxes.Add(transform.GetChild (4));

        stars.Add (transform.GetChild (5));
        stars.Add (transform.GetChild (6));
        stars.Add (transform.GetChild (7));
        stars.Add (transform.GetChild (8));
        stars.Add (transform.GetChild (9));

        colorIndicators.Add (Colors.Blue, blueIndicator);
        colorIndicators.Add (Colors.Green, greenIndicator);
        colorIndicators.Add (Colors.Orange, orangeIndicator);
        colorIndicators.Add (Colors.Red, redIndicator);

        disableAll ();
        startMultiplierSet (2);

        updateMultiplier ();
    }
    void Start()
    {
        spawnLeftCooldown = new Cooldown(initialSpawnTime);
        spawnLeftCooldown.startCooldown();
        spawnRightCooldown = new Cooldown(initialSpawnTime);
        spawnRightCooldown.startCooldown();

        colorPrefabs.Add (Colors.Blue, bluePrefab);
        colorPrefabs.Add (Colors.Green, greenPrefab);
        colorPrefabs.Add (Colors.Red, redPrefab);
        colorPrefabs.Add (Colors.Orange, orangePrefab);
    }
    void Start()
    {
        controller = GetComponent<Controller2D>();
        jumped = false;
        canPull = false;
        gravity = -(2 * jumpHeight) / Mathf.Pow(timeToJumpApex, 2);
        jumpVelocity = Mathf.Abs(gravity) * timeToJumpApex;

        //jumpVector = new Vector2(0, jumpForce);
        rb = this.GetComponent<Rigidbody2D>();
        //initializing cooldowns
        cooldowns["blink"] = new Cooldown(blinkCooldown, 0);
        cooldowns["port"] = new Cooldown(portCooldown, 0);

        controller.collisionMask =  ~(1 << LayerMask.NameToLayer("Player") | 1 << LayerMask.NameToLayer ("Background Image"));
    }