public CombatCharacter()
        {
            ID                       = Guid.NewGuid().ToString();
            Name                     = "Enemy";
            ProgressionGain          = new ProgressionGain();
            MaxItemsFromLootTable    = 1;
            ReputationId             = "Core_EnemyReputation";
            PrefabReplacementOnDeath = "";
            IsAggressive             = false;
            CharacterType            = CharacterType.Enemy;
            GuaranteedLoot           = new List <LootDefinition>();
            LootTables               = new List <LootOptions>();
            EnemySkills              = new List <Rm_NPCSkill>();
            NpcDamage                = new Damage()
            {
                MaxDamage = 1, MinDamage = 1
            };
            AttackCounter         = 1;
            RetreatsWhenLow       = false;
            ProjectileTravelSound = new AudioContainer();
            AutoAttackImpactSound = new AudioContainer();
            ProjectileSpeed       = 10f;
            TauntHandler          = new TauntHandler();
            CharPrefabPath        = "";

            OverrideAggroRadius      = false;
            OverrideAggroRadiusValue = 25f;
        }
示例#2
0
        public Skill()
        {
            ID                = Guid.NewGuid().ToString();
            Name              = "New Skill";
            AllClasses        = true;
            Unlocked          = true;
            CurrentRank       = 0;
            MaxRank           = 1;
            AnimationsToUse   = new List <SkillAnimationDefinition>();
            SkillStatistics   = new List <SkillStatistics>();
            MinCastRange      = 0.0f;
            CastRange         = 5.0f;
            LandTime          = 0.1F;
            UseResourceOnCast = true;
            MovementType      = SkillMovementType.StayInPlace;
            MoveToSpeed       = 25f;
            JumpToHeight      = 5.0f;
            ClassIDs          = new List <string>();
            SkillMetaID       = "";
            UpgradeType       = Rm_RPGHandler.Instance.Combat.DefaultUpgradeType;
            Image             = new ImageContainer();
            CastingSound      = new AudioContainer();
            Sound             = new AudioContainer();
            ImpactSound       = new AudioContainer();
            RequiredSkills    = new List <StringField>();

            AutomaticallyUnlockAtLevel = false;
            LevelToAutomaticallyUnlock = 1;
        }
示例#3
0
 public ProjectileSkill()
 {
     Name = "New Projectile Skill";
     ProjectileSkillStatistics = new List <ProjectileSkillStatistics>();
     TravelSound = new AudioContainer();
     SkillType   = SkillType.Projectile;
     TargetType  = TargetType.Enemy;
 }
        public void Init(BaseCharacterMono caster, Damage damage, BaseCharacterMono target, Vector3 targetPos = default(Vector3))
        {
            Caster             = caster.Character;
            CasterMono         = caster;
            _damage            = damage;
            Target             = target;
            Direction          = targetPos;
            _baseHeight        = transform.localScale.y + 0.2f;
            transform.position = transform.position + new Vector3(0, _baseHeight, 0);

            var spawnPosition = caster.GetComponentInChildren <ProjectileSpawnPosition>();

            if (spawnPosition != null)
            {
                transform.position = spawnPosition.transform.position;
            }

            if (Direction != Vector3.zero)
            {
                transform.LookAt(Direction);
            }
            else if (target != null)
            {
                transform.LookAt(target.transform.position);
            }
            else
            {
                Destroy(gameObject);
                return;
            }

            //todo: hi

            if (caster.Character.CharacterType == CharacterType.Player)
            {
                var player   = (PlayerCharacter)caster.Character;
                var classDef = Rm_RPGHandler.Instance.Player.CharacterDefinitions.First(c => c.ID == player.PlayerCharacterID);
                ProjectileSpeed  = classDef.ProjectileSpeed;
                ImpactPrefabPath = classDef.AutoAttackImpactPrefabPath;
                ImpactSound      = classDef.AutoAttackImpactSound;
                TravelSound      = classDef.ProjectileTravelSound;

                var weapon = player.Equipment.EquippedWeapon as Weapon;
                weapon = weapon ?? player.Equipment.EquippedOffHand as Weapon;
                if (weapon != null)
                {
                    var wepDef = Rm_RPGHandler.Instance.Items.WeaponTypes.First(w => w.ID == weapon.WeaponTypeID);
                    ProjectileSpeed  = wepDef.ProjectileSpeed;
                    ImpactPrefabPath = wepDef.AutoAttackImpactPrefabPath;
                    ImpactSound      = wepDef.AutoAttackImpactSound;
                    TravelSound      = wepDef.ProjectileTravelSound;
                }
            }
            else
            {
                var cc = (CombatCharacter)caster.Character;
                ProjectileSpeed  = cc.ProjectileSpeed;
                ImpactPrefabPath = cc.AutoAttackImpactPrefabPath;
                ImpactSound      = cc.AutoAttackImpactSound;
                TravelSound      = cc.ProjectileTravelSound;
            }

            if (TravelSound.Audio != null)
            {
                SoundGameObject = AudioPlayer.Instance.Play(TravelSound.Audio, AudioType.SoundFX, transform.position, transform);
                SoundGameObject.GetComponent <AudioSource>().loop = true;
                SoundGameObject.AddComponent <DestroyHelper>().Init(DestroyCondition.GameObjectIsNull, gameObject);
            }

            Destroy(gameObject, 5.0f);
            _initialised = true;
        }