public override void OnFire(Vector2 position, DynamicFloat rotation)
        {
            float rotationValue = rotation.Value;
            float rangeValue    = Range.Value;

            FireSingle(position, rotationValue + 0.5f * Random.Range(-rangeValue, rangeValue));
        }
Ejemplo n.º 2
0
        public override void OnFire(Vector2 position, DynamicFloat rotation)
        {
            int burstCount = Mathf.Abs(count.Value);

            if (burstCount == 1)
            {
                FireSingle(position, rotation);
            }
            else
            {
                float burstRange = range.Value;
                float start      = rotation - burstRange * 0.5f;
                float delta      = burstRange / (burstCount - 1);

                float deltaV  = deltaSpeed.Value;
                float deltaAV = deltaAngularSpeed.Value;

                DynamicFloat tempSpeed  = Speed;
                DynamicFloat tempASpeed = AngularSpeed;

                for (int i = 0; i < burstCount; i++)
                {
                    Speed        += deltaV;
                    AngularSpeed += deltaAV;
                    FireSingle(position, start + i * delta);
                }

                Speed        = tempSpeed;
                AngularSpeed = tempASpeed;
            }
        }
Ejemplo n.º 3
0
        public static int Compare(DynamicFloat lhs, DynamicFloat rhs)
        {
            if ((lhs == null) && (rhs == null))
            {
                return(0);
            }
            if (lhs == null)
            {
                return(-1);
            }
            if (rhs == null)
            {
                return(1);
            }
            int num = lhs.isDynamic.CompareTo(rhs.isDynamic);

            if (num == 0)
            {
                num = Compare(lhs.dynamicKey, rhs.dynamicKey);
                if (num != 0)
                {
                    return(num);
                }
                num = lhs.fixedValue.CompareTo(rhs.fixedValue);
                if (num != 0)
                {
                    return(num);
                }
            }
            return(num);
        }
Ejemplo n.º 4
0
 public float Evaluate(DynamicFloat target)
 {
     if (target.isDynamic)
     {
         return(this.GetProperty(target.dynamicKey));
     }
     return(target.fixedValue);
 }
Ejemplo n.º 5
0
 public LinearBurstModifier(DynamicInt depth,
                            DynamicFloat deltaSpeed,
                            DynamicFloat deltaAngularSpeed)
 {
     this.depth             = depth;
     this.deltaSpeed        = deltaSpeed;
     this.deltaAngularSpeed = deltaAngularSpeed;
 }
Ejemplo n.º 6
0
 public sealed override void OnFire(Vector2 position, DynamicFloat rotation)
 {
     UpdateSourcePoints(position, rotation);
     for (int i = 0; i < SourcePoints.Count; i++)
     {
         FireSingle(SourcePoints[i].Position, SourcePoints[i].BaseRotation);
     }
 }
        public override void OnFire(Vector2 position, DynamicFloat rotation)
        {
            DynamicFloat oldVelocity = Speed;
            float        rangeValue  = Range.Value;

            Speed = oldVelocity + Random.Range(-0.5f * rangeValue, 0.5f * rangeValue);
            FireSingle(position, rotation);
            Speed = oldVelocity;
        }
        public override void OnFire(Vector2 position, DynamicFloat rotation)
        {
            float oldAV      = AngularSpeed;
            float rangeValue = Range.Value;

            AngularSpeed = oldAV + 0.5f * Random.Range(-rangeValue, rangeValue);
            FireSingle(position, rotation);
            AngularSpeed = oldAV;
        }
Ejemplo n.º 9
0
        protected override void OnInitialize(GameHudModel model)
        {
            var attributesData = model.PlayerManager.PlayerActor.GetData <AttributesData>();

            _healthProperty = attributesData.Attributes[Attribute.Health];
            _healthProperty.PropertyChanged += HandleHealthChanged;

            _healthBar.material.SetFloat("_value", _healthProperty.Percentage());
            _healthBarUpdate = StartCoroutine(UpdateHealthBar());
        }
Ejemplo n.º 10
0
 public PolygonSource(DynamicFloat size,
                      DynamicInt edgeCount,
                      DynamicInt pointsPerEdge,
                      RotationType type)
 {
     this.size          = size;
     this.edgeCount     = edgeCount;
     this.pointsPerEdge = pointsPerEdge;
     this.type          = type;
 }
Ejemplo n.º 11
0
 public CircularBurstModifier(DynamicFloat range,
                              DynamicInt count,
                              DynamicFloat deltaSpeed,
                              DynamicFloat deltaAngularSpeed)
 {
     this.range             = range;
     this.count             = count;
     this.deltaSpeed        = deltaSpeed;
     this.deltaAngularSpeed = deltaAngularSpeed;
 }
Ejemplo n.º 12
0
        public override void OnFire(Vector2 position, DynamicFloat rotation)
        {
            DanmakuPrefab oldPrefab = Prefab;

            Prefab = newPrefab;

            FireSingle(position, rotation);

            Prefab = oldPrefab;
        }
Ejemplo n.º 13
0
        public override void OnFire(Vector2 position, DynamicFloat rotation)
        {
            DanmakuController temp = controllerAggregate;

            if (controllers != null)
            {
                for (int i = 0; i < controllers.Length; i++)
                {
                    temp += controllers[i].Update;
                }
            }

            Controller += temp;
            FireSingle(position, rotation);
            Controller -= temp;
        }
Ejemplo n.º 14
0
        public override void OnFire(Vector2 position, DynamicFloat rotation)
        {
            DynamicFloat tempSpeed  = Speed;
            DynamicFloat tempASpeed = AngularSpeed;
            DynamicFloat deltaV     = DeltaSpeed;
            DynamicFloat deltaAV    = DeltaAngularSpeed;
            float        depth      = Depth.Value;

            for (int i = 0; i < depth; i++)
            {
                Speed        += deltaV;
                AngularSpeed += deltaAV;
                FireSingle(position, rotation);
            }
            Speed        = tempSpeed;
            AngularSpeed = tempASpeed;
        }
Ejemplo n.º 15
0
        public float Evaluate(DynamicFloat dynamicFloat)
        {
            if (!dynamicFloat.isDynamic)
            {
                return(dynamicFloat.fixedValue);
            }
            if (this.argumentRecieved && (this.config.UseAbilityArgumentAsSpecialKey == dynamicFloat.dynamicKey))
            {
                return(this.argumentSpecialValue);
            }
            if (!this._overrideMap.ContainsKey(dynamicFloat.dynamicKey))
            {
                return((float)this.config.AbilitySpecials[dynamicFloat.dynamicKey]);
            }
            object obj2 = this._overrideMap[dynamicFloat.dynamicKey];

            if (obj2 is SafeFloat)
            {
                return((float)((SafeFloat)obj2));
            }
            return((float)obj2);
        }
        protected override void OnInitialize(IActor owner)
        {
            var attributesData = owner.GetData <AttributesData>();

            var hasAttribute = attributesData.Attributes.TryGetValue(_attribute, out var property);

            if (!hasAttribute)
            {
                Debug.LogWarning($"Actor {owner.GetGameObject().name} doesn't have the {_attribute}" +
                                 " attribute in data");
                return;
            }

            _attributeFloat = property;
            _camera         = owner.Camera;

            var ownerTransform = owner.GetData <TransformData>().GetTransform();

            _bar          = Instantiate(_bar, new Vector3(0, _height, 0), Quaternion.identity);
            _barTransform = _bar.transform;
            _barTransform.SetParent(ownerTransform, false);

            base.OnInitialize(owner);
        }
Ejemplo n.º 17
0
 public RandomizeAngleModifier(DynamicFloat range)
 {
     this.range = range;
 }
Ejemplo n.º 18
0
 float IAttacker.Evaluate(DynamicFloat target)
 {
     return(base.Evaluate(target));
 }
Ejemplo n.º 19
0
 public CircleSource(DynamicFloat radius, DynamicInt count, bool normal = false)
 {
     this.radius = radius;
     this.count  = count;
     this.normal = normal;
 }
Ejemplo n.º 20
0
 public override void OnFire(Vector2 position, DynamicFloat rotation)
 {
     Controller = null;
     FireSingle(position, rotation);
 }
 public RandomizeAngularVelocityModifier(DynamicFloat range)
 {
     this.range = range;
 }
Ejemplo n.º 22
0
 public SourcePoint(Vector2 location, DynamicFloat rotation)
 {
     this.Position     = location;
     this.BaseRotation = rotation;
 }