Exemple #1
0
 public static void SetupChromaDroids()
 {
     //TOM
     #region SetupTom
     if (redDroidPrefab == null || !CompanionBuilder.companionDictionary.ContainsKey(RedDroidGuid))
     {
         redDroidPrefab = CompanionBuilder.BuildPrefab("ChromaGun Red Droid", RedDroidGuid, "NevernamedsItems/Resources/Companions/ChromaGunDroids/chromadroid_red_idle_001", new IntVector2(5, 1), new IntVector2(6, 6));
         var companionController = redDroidPrefab.AddComponent <CompanionController>();
         companionController.aiActor.MovementSpeed     = 6.5f;
         companionController.CanCrossPits              = true;
         companionController.aiActor.CollisionDamage   = 0;
         companionController.aiActor.ActorShadowOffset = new Vector3(0, -0.5f);
         redDroidPrefab.AddAnimation("idle", "NevernamedsItems/Resources/Companions/ChromaGunDroids/chromadroid_red_idle", 12, CompanionBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
         BehaviorSpeculator component = redDroidPrefab.GetComponent <BehaviorSpeculator>();
         CustomCompanionBehaviours.SimpleCompanionMeleeAttack redDroidAttack = new CustomCompanionBehaviours.SimpleCompanionMeleeAttack();
         redDroidAttack.DamagePerTick         = 5;
         redDroidAttack.DesiredDistance       = 2;
         redDroidAttack.TickDelay             = 1f;
         redDroidAttack.selfKnockbackAmount   = 10;
         redDroidAttack.targetKnockbackAmount = 10;
         CustomCompanionBehaviours.ChromaGunDroneApproach redDroidApproach = new CustomCompanionBehaviours.ChromaGunDroneApproach();
         redDroidApproach.DesiredDistance = 1;
         redDroidApproach.droneColour     = ColourType.RED;
         component.MovementBehaviors.Add(redDroidApproach);
         component.AttackBehaviors.Add(redDroidAttack);
         component.MovementBehaviors.Add(new CompanionFollowPlayerBehavior {
             IdleAnimations = new string[] { "idle" }
         });
     }
     #endregion
 }
Exemple #2
0
 public static void BuildDenkSnavelPrefab()
 {
     if (prefab == null || !CompanionBuilder.companionDictionary.ContainsKey(guid))
     {
         prefab = CompanionBuilder.BuildPrefab("Gumgun Denksnavel", guid, "NevernamedsItems/Resources/Companions/Denksnavel/denksnavel_idle_left_001", new IntVector2(5, 0), new IntVector2(5, 13));
         var companionController = prefab.AddComponent <DenksnavelController>();
         companionController.aiActor.MovementSpeed     = 6.5f;
         companionController.CanCrossPits              = true;
         companionController.aiActor.ActorShadowOffset = new Vector3(0, -0.5f);
         prefab.AddAnimation("idle_right", "NevernamedsItems/Resources/Companions/Denksnavel/denksnavel_idle_right", 12, CompanionBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.TwoWayHorizontal, DirectionalAnimation.FlipType.None);
         prefab.AddAnimation("idle_left", "NevernamedsItems/Resources/Companions/Denksnavel/denksnavel_idle_left", 12, CompanionBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.TwoWayHorizontal, DirectionalAnimation.FlipType.None);
         companionController.aiAnimator.GetDirectionalAnimation("idle").Prefix = "idle";
         BehaviorSpeculator component = prefab.GetComponent <BehaviorSpeculator>();
         CustomCompanionBehaviours.SimpleCompanionMeleeAttack denksnavelattack = new CustomCompanionBehaviours.SimpleCompanionMeleeAttack();
         denksnavelattack.DamagePerTick   = 5;
         denksnavelattack.DesiredDistance = 2;
         denksnavelattack.TickDelay       = 1;
         CustomCompanionBehaviours.SimpleCompanionApproach denksnavelapproach = new CustomCompanionBehaviours.SimpleCompanionApproach();
         denksnavelapproach.DesiredDistance = 1;
         component.MovementBehaviors.Add(denksnavelapproach);
         component.AttackBehaviors.Add(denksnavelattack);
         component.MovementBehaviors.Add(new CompanionFollowPlayerBehavior {
             IdleAnimations = new string[] { "idle" }
         });
     }
 }