public DamageFromAttack(SourceHistory sourceHistory, float damageScale, bool isHpPercent, float weight, float skillPowerScale,
                         int casterId, Vector2 projectilePosition,
                         Vector2 impactPosition, BakedStatsContainer characterStats,
                         bool forceAddModifier       = false,
                         DeathBehavior deathBehavior = CastProjectileAction.DeathBehavior.Neutral,
                         bool requireCasterToBeAlive = true, bool isHpPercentBaseOnMaxHp = false)
 {
     if (characterStats == null)
     {
         throw new Exception("null character stats");
     }
     this.sourceHistory          = sourceHistory;
     this.damageScale            = damageScale;
     this.isHpPercent            = isHpPercent;
     this.weight                 = weight;
     this.skillPowerScale        = skillPowerScale;
     this.casterId               = casterId;
     this.projectilePosition     = projectilePosition;
     this.impactPosition         = impactPosition;
     this.characterStats         = characterStats;
     this.forceAddModifier       = forceAddModifier;
     this.deathBehavior          = deathBehavior;
     this.requireCasterToBeAlive = requireCasterToBeAlive;
     this.isHpPercentBaseOnMaxHp = isHpPercentBaseOnMaxHp;
 }
        public BleedModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity, Environment environment, CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.casterEntity     = casterEntity;
            this.info             = (BleedInfo)info;
            this.environment      = environment;
            targetHealthComponent = targetEntity.GetComponent <HealthComponent>();
            StatsComponent casterStats = casterEntity.GetComponent <StatsComponent>();

            characterStats = casterStats.CharacterStats;
        }
        public DamageOverTimeModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity,
                                      Environment environment, Skill parentSkill, SkillId skillId,
                                      CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.info        = (DamageOverTimeInfo)info;
            this.environment = environment;
            this.parentSkill = parentSkill;
            this.skillId     = skillId;
            bool           found;
            StatsComponent casterStats = casterEntity.GetComponent <StatsComponent>();

            casterAtk               = (int)casterStats.CharacterStats.FindStats(StatsType.RawAtk, out found).BakedFloatValue;
            timeUntilNextDamage     = this.info.DotModifierConfig.interval;
            targetHealthComponent   = targetEntity.GetComponent <HealthComponent>();
            targetMovementComponent = targetEntity.GetComponent <MovementComponent>();
            characterStats          = casterStats.CharacterStats;
            casterCleanupComponent  = casterEntity.GetComponent <CleanupComponent>();
        }
示例#4
0
        public RagdollModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity,
                               Camera camera, SkillId skillId, Environment environment,
                               CollectionOfInteractions modifierInteractionCollection,
                               WallHitConfig wallHitConfig, float damageScale,
                               ProjectileComponent projectile) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.casterEntity = casterEntity;
            this.targetEntity = targetEntity;
            this.camera       = camera;
            this.skillId      = skillId;
            this.environment  = environment;
            this.whc          = wallHitConfig;
            this.damageScale  = damageScale;
            this.projectile   = projectile;
            this.info         = (RagdollInfo)info;

            easingFunc = EasingFunctions.GetEasingFunction(EasingFunctions.Functions.EaseOutQuad);
            CalculateDurations(this.info);
            switch (this.info.RagdollModifierConfig.ShowAnimationProfile())
            {
            case BlastModifierConfig.AnimationProfile.Far:
                animProfile = new FarAnimProfile();
                break;

            case BlastModifierConfig.AnimationProfile.High:
                animProfile = new HighAnimProfile();
                break;

            case BlastModifierConfig.AnimationProfile.Medium:
                animProfile = new MediumAnimProfile();
                break;
            }
            targetCharacter = targetEntity.GetComponent <SkillComponent>().Character;
            StatsComponent casterStatsComponent = casterEntity.GetComponent <StatsComponent>();

            characterStats = casterStatsComponent.CharacterStats;
            //DLog.Log("RagdollModifier: state: " + state);
        }
示例#5
0
        public KnockdownModifier(KnockdownInfo knockdownInfo, Vector3 collidedProjectilePosition,
                                 Vector3 collidedProjectileVelocity,
                                 Entity caster, Entity target, Camera camera, SkillId skillId,
                                 Environment environment, CollectionOfInteractions modifierInteractionCollection,
                                 WallHitConfig wallHitConfig, float damageScale) : base(knockdownInfo, caster, target, environment, modifierInteractionCollection)
        {
            this.knockdownInfo = knockdownInfo;
            this.collidedProjectilePosition = collidedProjectilePosition;
            this.collidedProjectileVelocity = collidedProjectileVelocity;
            this.caster       = caster;
            this.target       = target;
            this.camera       = camera;
            this.skillId      = skillId;
            this.environment  = environment;
            this.whc          = wallHitConfig;
            this.damageScale  = damageScale;
            movementComponent = target.GetComponent <MovementComponent>();
            targetAnimation   = target.GetComponent <AnimationComponent>().Animation;
            targetCharacter   = target.GetComponent <SkillComponent>().Character;
            UserInput userInput = target.GetComponent <HeroStateMachineComponent>().UserInput;

            targetDefaultUserInput = (DefaultUserInput)userInput;

            StatsComponent targetStatsComponent = targetEntity.GetComponent <StatsComponent>();
            bool           found;

            extraLyingDurationStats = targetStatsComponent.CharacterStats.FindStats(
                StatsType.ExtraLyingDuration, out found
                );
            if (found)
            {
                lifetime.DynamicExtraDuration += extraLyingDurationStats.BakedFloatValue;
            }
            StatsComponent casterStatsComponent = casterEntity.GetComponent <StatsComponent>();

            characterStats          = casterStatsComponent.CharacterStats;
            casterMovementComponent = casterEntity.GetComponent <MovementComponent>();
        }