-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathEnforcerSurvivor.cs
669 lines (536 loc) · 31.7 KB
/
EnforcerSurvivor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
using BepInEx.Configuration;
using RoR2;
using System;
using UnityEngine;
using Modules.Characters;
using EntityStates.Enforcer;
using EntityStates;
using System.Linq;
using RoR2.Skills;
using EntityStates.Enforcer.NeutralSpecial;
using EnforcerPlugin;
using R2API;
using System.Runtime.CompilerServices;
using RoR2.CharacterAI;
namespace Modules.Characters {
public class EnforcerSurvivor : SurvivorBase {
public override string characterName => "Enforcer";
public const string ENFORCER_PREFIX = "ENFORCER_";
public override string survivorTokenPrefix => ENFORCER_PREFIX;
public override BodyInfo bodyInfo => new BodyInfo {
bodyName = "EnforcerBody",
bodyNameToken = ENFORCER_PREFIX + "NAME",
subtitleNameToken = ENFORCER_PREFIX + "SUBTITLE",
bodyColor = new Color(0.26f, 0.27f, 0.46f),
characterPortrait = Asset.charPortrait,
sortPosition = 5.1f,
crosshair = Modules.Asset.LoadCrosshair("SMG"),
podPrefab = RoR2.LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/SurvivorPod"),
//stats
maxHealth = Modules.Config.baseHealth.Value,
healthRegen = Modules.Config.baseRegen.Value,
armor = Modules.Config.baseArmor.Value,
damage = Modules.Config.baseDamage.Value,
crit = Modules.Config.baseCrit.Value,
moveSpeed = Modules.Config.baseMovementSpeed.Value,
jumpCount = 1,
//level stats
healthGrowth = Modules.Config.healthGrowth.Value,
regenGrowth = Modules.Config.regenGrowth.Value,
armorGrowth = Modules.Config.armorGrowth.Value,
damageGrowth = Modules.Config.damageGrowth.Value,
};
public override CustomRendererInfo[] customRendererInfos {
get => new CustomRendererInfo[] {
new CustomRendererInfo {
childName = "ShieldModel",
//material = Materials.CreateHotpooMaterial("matEnforcerShield"),
},
new CustomRendererInfo {
childName = "ShieldGlassModel",
dontHotpoo = true,
ignoreOverlays = true,
},
new CustomRendererInfo {
childName = "SkamteBordModel",
},
new CustomRendererInfo {
childName = "GunModel",
},
new CustomRendererInfo {
childName = "SuperGunModel",
},
new CustomRendererInfo {
childName = "HMGModel",
},
new CustomRendererInfo {
childName = "HammerModel",
},
new CustomRendererInfo {
childName = "PauldronModel",
},
new CustomRendererInfo {
childName = "Model",
},
};}
public override Type characterMainState => typeof(EnforcerMain);
public override ItemDisplaysBase itemDisplays => null; //item displays handled by our own script instead of the new system
public override UnlockableDef characterUnlockableDef => EnforcerUnlockables.enforcerUnlockableDef;
public override ConfigEntry<bool> characterEnabledConfig => null;
//SOC SOC
public static SkillDef shieldEnterDef;
public static SkillDef shieldExitDef;
public static SkillDef energyShieldEnterDef;
public static SkillDef energyShieldExitDef;
public static SkillDef boardEnterDef;
public static SkillDef boardExitDef;
public override void Initialize() {
base.Initialize();
Hooks();
}
private void Hooks() {
}
#region characterbody stuff
protected override void InitializeCharacterBodyAndModel() {
base.InitializeCharacterBodyAndModel();
//...what?
// https://youtu.be/zRXl8Ow2bUs
bodyPrefab.GetComponent<SfxLocator>().deathSound = Sounds.DeathSound;
characterBodyModel.GetComponent<ChildLocator>().FindChild("Chair").GetComponent<MeshRenderer>().material.SetHotpooMaterial();
//childLocator.FindChild("BungusShieldFill").gameObject.AddComponent<ObjectScaleCurve>().timeMax = 0.3f;
ChildLocator locator = characterBodyModel.GetComponent<ChildLocator>();
bodyPrefab.gameObject.AddComponent<EnforcerComponent>().Init();
//comp.childLocator = locator;
//comp.cameraShit2 = characterBodyModel.GetComponent<CameraTargetParams>();
//comp.drOctagonapus = EntityStateMachine.FindByCustomName(bodyPrefab, "EnforcerParry");
bodyPrefab.gameObject.AddComponent<EnforcerWeaponComponent>().Init();
if(EnforcerModPlugin.VREnabled)
bodyPrefab.gameObject.AddComponent<EnforcerVRComponent>();
bodyPrefab.gameObject.AddComponent<EnforcerNetworkComponent>();
bodyPrefab.gameObject.AddComponent<EnforcerLightController>();
bodyPrefab.gameObject.AddComponent<EnforcerLightControllerAlt>();
if (EnforcerModPlugin.IDPHelperInstalled) {
characterBodyModel.gameObject.AddComponent<EnforcerItemDisplayEditorComponent>();
}
}
protected override void InitializeDisplayPrefab() {
base.InitializeDisplayPrefab();
displayPrefab.AddComponent<MenuSoundComponent>();
displayPrefab.AddComponent<EnforcerLightController>();
displayPrefab.AddComponent<EnforcerLightControllerAlt>();
}
public override void InitializeHurtboxes(HealthComponent healthComponent) {
HurtBoxGroup mainHurtboxGroup = characterBodyModel.gameObject.GetComponent<HurtBoxGroup>();
ChildLocator childLocator = characterBodyModel.GetComponent<ChildLocator>();
//make a hurtbox for the shield since this works apparently !
HurtBox shieldHurtbox = childLocator.FindChild("ShieldHurtbox").gameObject.AddComponent<HurtBox>();
shieldHurtbox.gameObject.layer = LayerIndex.entityPrecise.intVal;
shieldHurtbox.healthComponent = healthComponent;
shieldHurtbox.isBullseye = false;
shieldHurtbox.damageModifier = HurtBox.DamageModifier.Barrier;
shieldHurtbox.hurtBoxGroup = mainHurtboxGroup;
HurtBox shieldHurtbox2 = childLocator.FindChild("ShieldHurtbox2").gameObject.AddComponent<HurtBox>();
shieldHurtbox2.gameObject.layer = LayerIndex.entityPrecise.intVal;
shieldHurtbox2.healthComponent = healthComponent;
shieldHurtbox2.isBullseye = false;
shieldHurtbox2.damageModifier = HurtBox.DamageModifier.Barrier;
shieldHurtbox2.hurtBoxGroup = mainHurtboxGroup;
mainHurtboxGroup.hurtBoxes = new HurtBox[] {
shieldHurtbox,
shieldHurtbox2,
mainHurtboxGroup.hurtBoxes[0],
};
}
public override void InitializeHitboxes() {
ChildLocator childLocator = characterBodyModel.GetComponent<ChildLocator>();
//make a hitbox for shoulder bash
HitBoxGroup hitBoxGroup = characterBodyModel.gameObject.AddComponent<HitBoxGroup>();
GameObject chargeHitbox = childLocator.FindChild("ChargeHitbox").gameObject;
HitBox hitBox = chargeHitbox.AddComponent<HitBox>();
chargeHitbox.layer = LayerIndex.projectile.intVal;
hitBoxGroup.hitBoxes = new HitBox[]
{
hitBox
};
hitBoxGroup.groupName = "Charge";
//hammer hitbox
HitBoxGroup hammerHitBoxGroup = characterBodyModel.gameObject.AddComponent<HitBoxGroup>();
GameObject hammerHitbox = childLocator.FindChild("ActualHammerHitbox").gameObject;
HitBox hammerHitBox = hammerHitbox.AddComponent<HitBox>();
hammerHitbox.layer = LayerIndex.projectile.intVal;
hammerHitBoxGroup.hitBoxes = new HitBox[]
{
hammerHitBox
};
hammerHitBoxGroup.groupName = "Hammer";
//hammer hitbox2
HitBoxGroup hammerHitBoxGroup2 = characterBodyModel.gameObject.AddComponent<HitBoxGroup>();
GameObject hammerHitbox2 = childLocator.FindChild("HammerHitboxBig").gameObject;
HitBox hammerHitBox2 = hammerHitbox2.AddComponent<HitBox>();
hammerHitbox2.layer = LayerIndex.projectile.intVal;
hammerHitBoxGroup2.hitBoxes = new HitBox[]
{
hammerHitBox2
};
hammerHitBoxGroup2.groupName = "HammerBig";
FootstepHandler footstepHandler = characterBodyModel.gameObject.AddComponent<FootstepHandler>();
footstepHandler.baseFootstepString = "Play_player_footstep";
footstepHandler.sprintFootstepOverrideString = "";
footstepHandler.enableFootstepDust = true;
footstepHandler.footstepDustPrefab = RoR2.LegacyResourcesAPI.Load<GameObject>("Prefabs/GenericFootstepDust");
}
protected override void InitializeEntityStateMachine() {
base.InitializeEntityStateMachine();
EntityStateMachine octagonapus = bodyPrefab.AddComponent<EntityStateMachine>();
octagonapus.customName = "EnforcerParry";
NetworkStateMachine networkStateMachine = bodyPrefab.GetComponent<NetworkStateMachine>();
networkStateMachine.stateMachines = networkStateMachine.stateMachines.Append(octagonapus).ToArray();
SerializableEntityStateType idleState = new SerializableEntityStateType(typeof(Idle));
octagonapus.initialStateType = idleState;
octagonapus.mainStateType = idleState;
}
#endregion characterbody stuff
#region skills
//add modifiers to your voids please
// no go fuck yourself :^)
// suck my dick
public override void InitializeSkills() {
Modules.Skills.CreateSkillFamilies(bodyPrefab);
InitializePrimarySkills();
InitializeSecondarySkills();
InitializeUtilitySkills();
InitializeSpecialSkills();
if (EnforcerModPlugin.ScepterInstalled) {
InitializeScepterSkills();
}
FinalizeCSSPreviewDisplayController();
//todo: fancy emote system/genericEmote
MemeSetup();
}
private void MemeSetup() {
Type[] memes = new Type[]
{
typeof(SirenToggle),
typeof(DefaultDance),
typeof(FLINTLOCKWOOD),
typeof(Rest),
typeof(Enforcer.Emotes.EnforcerSalute),
typeof(EntityStates.Nemforcer.Emotes.Salute),
};
for (int i = 0; i < memes.Length; i++) {
Modules.Content.AddEntityState(memes[i]);
}
}
private void InitializePrimarySkills() {
Content.AddEntityState(typeof(FireNeedler),
typeof(RiotShotgun),
typeof(SuperShotgun2),
typeof(FireMachineGun),
typeof(HammerSwing));
SkillDef primarySkillDef1 = EnforcerSkillDefs.PrimarySkillDef_RiotShotgun();
SkillDef primarySkillDef2 = EnforcerSkillDefs.PrimarySkillDef_SuperShotgun();
SkillDef primarySkillDef3 = EnforcerSkillDefs.PrimarySkillDef_AssaultRifle();
SkillDef primarySkillDef4 = EnforcerSkillDefs.PrimarySkillDef_Hammer();
Modules.Skills.AddPrimarySkills(bodyPrefab, primarySkillDef1, primarySkillDef2, primarySkillDef3);
Modules.Skills.AddUnlockablesToFamily(bodyPrefab.GetComponent<SkillLocator>().primary.skillFamily,
null,
EnforcerUnlockables.enforcerDoomUnlockableDef,
EnforcerUnlockables.enforcerARUnlockableDef);
SkillLocator skillLocator = bodyPrefab.GetComponent<SkillLocator>();
CharacterSelectSurvivorPreviewDisplayController previewController = displayPrefab.GetComponent<CharacterSelectSurvivorPreviewDisplayController>();
previewController.skillChangeResponses[0].triggerSkillFamily = skillLocator.primary.skillFamily;
previewController.skillChangeResponses[0].triggerSkill = primarySkillDef1;
previewController.skillChangeResponses[1].triggerSkillFamily = skillLocator.primary.skillFamily;
previewController.skillChangeResponses[1].triggerSkill = primarySkillDef2;
previewController.skillChangeResponses[2].triggerSkillFamily = skillLocator.primary.skillFamily;
previewController.skillChangeResponses[2].triggerSkill = primarySkillDef3;
if (Modules.Config.cursed.Value) {
Modules.Skills.AddSkillToFamily(skillLocator.primary.skillFamily, primarySkillDef4);
previewController.skillChangeResponses[3].triggerSkillFamily = skillLocator.primary.skillFamily;
previewController.skillChangeResponses[3].triggerSkill = primarySkillDef4;
}
}
private void InitializeSecondarySkills() {
Content.AddEntityState(typeof(ShieldBash));
Content.AddEntityState(typeof(ShoulderBash));
Content.AddEntityState(typeof(ShoulderBashImpact));
SkillDef secondarySkilldef1 = EnforcerSkillDefs.SecondarySkillDef_Bash();
Modules.Skills.AddSecondarySkills(bodyPrefab, secondarySkilldef1);
}
private void InitializeUtilitySkills() {
Content.AddEntityState(typeof(AimTearGas));
Content.AddEntityState(typeof(TearGas));
Content.AddEntityState(typeof(StunGrenade));
SkillDef utilitySkillDef1 = EnforcerSkillDefs.UtilitySkillDef_TearGas();
SkillDef utilitySkillDef2 = EnforcerSkillDefs.UtilitySkillDef_StunGrenade();
Modules.Skills.AddUtilitySkills(bodyPrefab, utilitySkillDef1, utilitySkillDef2);
Modules.Skills.AddUnlockablesToFamily(bodyPrefab.GetComponent<SkillLocator>().utility.skillFamily,
null,
EnforcerUnlockables.enforcerStunGrenadeUnlockableDef);
}
private void InitializeSpecialSkills() {
Content.AddEntityState(typeof(ProtectAndServe));
Content.AddEntityState(typeof(EnergyShield));
Content.AddEntityState(typeof(Skateboard));
shieldEnterDef = EnforcerSkillDefs.SpecialSkillDef_ProtectAndServe();
shieldExitDef = EnforcerSkillDefs.SpecialSkillDef_ShieldDown();
energyShieldEnterDef = EnforcerSkillDefs.SpecialSkillDef_EnergyShield();
energyShieldExitDef = EnforcerSkillDefs.SpecialSkillDef_EnergyShieldDown();
boardEnterDef = EnforcerSkillDefs.SpecialSkillDef_SkamteBord();
boardExitDef = EnforcerSkillDefs.SpecialSkillDef_SkamteBordDown();
Modules.Skills.AddSpecialSkills(bodyPrefab, shieldEnterDef);
//CSSPDC
SkillLocator skillLocator = bodyPrefab.GetComponent<SkillLocator>();
CharacterSelectSurvivorPreviewDisplayController previewController = displayPrefab.GetComponent<CharacterSelectSurvivorPreviewDisplayController>();
previewController.skillChangeResponses[4].triggerSkillFamily = skillLocator.special.skillFamily;
previewController.skillChangeResponses[4].triggerSkill = shieldEnterDef;
if (Modules.Config.cursed.Value) {
Modules.Skills.AddSkillToFamily(skillLocator.special.skillFamily, boardEnterDef);
//CSSPDC
previewController.skillChangeResponses[5].triggerSkillFamily = skillLocator.special.skillFamily;
previewController.skillChangeResponses[5].triggerSkill = boardEnterDef;
////rip energy shield lol
////previewController.skillChangeResponses[6].triggerSkillFamily = skillLocator.special.skillFamily;
////previewController.skillChangeResponses[6].triggerSkill = energyShieldEnterDef;
}
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
private void InitializeScepterSkills() {
SkillDef tearGasScepterDef = EnforcerSkillDefs.UtilitySkillDef_TearGas();
tearGasScepterDef.activationState = new SerializableEntityStateType(typeof(AimDamageGas));
tearGasScepterDef.icon = Asset.icon30TearGasScepter;
tearGasScepterDef.skillDescriptionToken = "ENFORCER_UTILITY_TEARGASSCEPTER_DESCRIPTION";
tearGasScepterDef.skillName = "ENFORCER_UTILITY_TEARGASSCEPTER_NAME";
tearGasScepterDef.skillNameToken = "ENFORCER_UTILITY_TEARGASSCEPTER_NAME";
tearGasScepterDef.keywordTokens = new string[] {
"KEYWORD_BLINDED"
};
Modules.Content.AddSkillDef(tearGasScepterDef);
Modules.Content.AddEntityState(typeof(AimDamageGas));
SkillDef shockGrenadeDef = EnforcerSkillDefs.UtilitySkillDef_StunGrenade();
shockGrenadeDef.activationState = new SerializableEntityStateType(typeof(ShockGrenade));
shockGrenadeDef.icon = Asset.icon31StunGrenadeScepter;
shockGrenadeDef.skillDescriptionToken = "ENFORCER_UTILITY_SHOCKGRENADE_DESCRIPTION";
shockGrenadeDef.skillName = "ENFORCER_UTILITY_SHOCKGRENADE_NAME";
shockGrenadeDef.skillNameToken = "ENFORCER_UTILITY_SHOCKGRENADE_NAME";
shockGrenadeDef.keywordTokens = new string[] {
"KEYWORD_SHOCKING"
};
Modules.Content.AddSkillDef(shockGrenadeDef);
Modules.Content.AddEntityState(typeof(ShockGrenade));
AncientScepter.AncientScepterItem.instance.RegisterScepterSkill(tearGasScepterDef, "EnforcerBody", SkillSlot.Utility, 0);
AncientScepter.AncientScepterItem.instance.RegisterScepterSkill(shockGrenadeDef, "EnforcerBody", SkillSlot.Utility, 1);
}
#endregion skills
#region ai
public override void InitializeDoppelganger() {
GameObject doppelganger = PrefabAPI.InstantiateClone(RoR2.LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/MercMonsterMaster"), "EnforcerMonsterMaster");
foreach (AISkillDriver ai in doppelganger.GetComponentsInChildren<AISkillDriver>()) {
UnityEngine.Object.DestroyImmediate(ai);
}
BaseAI baseAI = doppelganger.GetComponent<BaseAI>();
baseAI.aimVectorMaxSpeed = 40;
baseAI.aimVectorDampTime = 0.2f;
AISkillDriver exitShieldDriver = doppelganger.AddComponent<AISkillDriver>();
exitShieldDriver.customName = "ExitShield";
exitShieldDriver.movementType = AISkillDriver.MovementType.Stop;
exitShieldDriver.moveTargetType = AISkillDriver.TargetType.CurrentEnemy;
exitShieldDriver.activationRequiresAimConfirmation = false;
exitShieldDriver.activationRequiresTargetLoS = false;
exitShieldDriver.selectionRequiresTargetLoS = false;
exitShieldDriver.maxDistance = 512f;
exitShieldDriver.minDistance = 45f;
exitShieldDriver.requireSkillReady = true;
exitShieldDriver.aimType = AISkillDriver.AimType.MoveDirection;
exitShieldDriver.ignoreNodeGraph = false;
exitShieldDriver.moveInputScale = 1f;
exitShieldDriver.driverUpdateTimerOverride = 0.5f;
exitShieldDriver.buttonPressType = AISkillDriver.ButtonPressType.Hold;
exitShieldDriver.minTargetHealthFraction = Mathf.NegativeInfinity;
exitShieldDriver.maxTargetHealthFraction = Mathf.Infinity;
exitShieldDriver.minUserHealthFraction = Mathf.NegativeInfinity;
exitShieldDriver.maxUserHealthFraction = Mathf.Infinity;
exitShieldDriver.skillSlot = SkillSlot.Special;
exitShieldDriver.requiredSkill = shieldExitDef;
/*AISkillDriver grenadeDriver = doppelganger.AddComponent<AISkillDriver>();
grenadeDriver.customName = "ThrowGrenade";
grenadeDriver.movementType = AISkillDriver.MovementType.ChaseMoveTarget;
grenadeDriver.moveTargetType = AISkillDriver.TargetType.CurrentEnemy;
grenadeDriver.activationRequiresAimConfirmation = true;
grenadeDriver.activationRequiresTargetLoS = false;
grenadeDriver.selectionRequiresTargetLoS = true;
grenadeDriver.requireSkillReady = true;
grenadeDriver.maxDistance = 64f;
grenadeDriver.minDistance = 0f;
grenadeDriver.aimType = AISkillDriver.AimType.AtCurrentEnemy;
grenadeDriver.ignoreNodeGraph = false;
grenadeDriver.moveInputScale = 1f;
grenadeDriver.driverUpdateTimerOverride = 0.5f;
grenadeDriver.buttonPressType = AISkillDriver.ButtonPressType.TapContinuous;
grenadeDriver.minTargetHealthFraction = Mathf.NegativeInfinity;
grenadeDriver.maxTargetHealthFraction = Mathf.Infinity;
grenadeDriver.minUserHealthFraction = Mathf.NegativeInfinity;
grenadeDriver.maxUserHealthFraction = Mathf.Infinity;
grenadeDriver.skillSlot = SkillSlot.Utility;*/
AISkillDriver shoulderBashDriver = doppelganger.AddComponent<AISkillDriver>();
shoulderBashDriver.customName = "ShoulderBash";
shoulderBashDriver.movementType = AISkillDriver.MovementType.ChaseMoveTarget;
shoulderBashDriver.moveTargetType = AISkillDriver.TargetType.CurrentEnemy;
shoulderBashDriver.activationRequiresAimConfirmation = true;
shoulderBashDriver.activationRequiresTargetLoS = false;
shoulderBashDriver.selectionRequiresTargetLoS = true;
shoulderBashDriver.maxDistance = 6f;
shoulderBashDriver.minDistance = 0f;
shoulderBashDriver.requireSkillReady = true;
shoulderBashDriver.aimType = AISkillDriver.AimType.AtCurrentEnemy;
shoulderBashDriver.ignoreNodeGraph = true;
shoulderBashDriver.moveInputScale = 1f;
shoulderBashDriver.driverUpdateTimerOverride = 2f;
shoulderBashDriver.buttonPressType = AISkillDriver.ButtonPressType.TapContinuous;
shoulderBashDriver.minTargetHealthFraction = Mathf.NegativeInfinity;
shoulderBashDriver.maxTargetHealthFraction = Mathf.Infinity;
shoulderBashDriver.minUserHealthFraction = Mathf.NegativeInfinity;
shoulderBashDriver.maxUserHealthFraction = Mathf.Infinity;
shoulderBashDriver.skillSlot = SkillSlot.Secondary;
//shoulderBashDriver.requiredSkill = shieldDownDef;
shoulderBashDriver.shouldSprint = true;
/*AISkillDriver shoulderBashPrepDriver = doppelganger.AddComponent<AISkillDriver>();
shoulderBashPrepDriver.customName = "ShoulderBashPrep";
shoulderBashPrepDriver.movementType = AISkillDriver.MovementType.ChaseMoveTarget;
shoulderBashPrepDriver.moveTargetType = AISkillDriver.TargetType.CurrentEnemy;
shoulderBashPrepDriver.activationRequiresAimConfirmation = true;
shoulderBashPrepDriver.activationRequiresTargetLoS = false;
shoulderBashPrepDriver.selectionRequiresTargetLoS = false;
shoulderBashPrepDriver.maxDistance = 12f;
shoulderBashPrepDriver.minDistance = 0f;
shoulderBashPrepDriver.requireSkillReady = true;
shoulderBashPrepDriver.aimType = AISkillDriver.AimType.AtCurrentEnemy;
shoulderBashPrepDriver.ignoreNodeGraph = true;
shoulderBashPrepDriver.moveInputScale = 1f;
shoulderBashPrepDriver.driverUpdateTimerOverride = -1f;
shoulderBashPrepDriver.buttonPressType = AISkillDriver.ButtonPressType.Abstain;
shoulderBashPrepDriver.minTargetHealthFraction = Mathf.NegativeInfinity;
shoulderBashPrepDriver.maxTargetHealthFraction = Mathf.Infinity;
shoulderBashPrepDriver.minUserHealthFraction = Mathf.NegativeInfinity;
shoulderBashPrepDriver.maxUserHealthFraction = Mathf.Infinity;
shoulderBashPrepDriver.skillSlot = SkillSlot.Secondary;
//shoulderBashPrepDriver.requiredSkill = shieldDownDef;
shoulderBashPrepDriver.shouldSprint = true;*/
AISkillDriver swapToMinigunDriver = doppelganger.AddComponent<AISkillDriver>();
swapToMinigunDriver.customName = "EnterShield";
swapToMinigunDriver.movementType = AISkillDriver.MovementType.Stop;
swapToMinigunDriver.moveTargetType = AISkillDriver.TargetType.CurrentEnemy;
swapToMinigunDriver.activationRequiresAimConfirmation = false;
swapToMinigunDriver.activationRequiresTargetLoS = false;
swapToMinigunDriver.selectionRequiresTargetLoS = false;
swapToMinigunDriver.maxDistance = 30f;
swapToMinigunDriver.minDistance = 0f;
swapToMinigunDriver.requireSkillReady = true;
swapToMinigunDriver.aimType = AISkillDriver.AimType.MoveDirection;
swapToMinigunDriver.ignoreNodeGraph = true;
swapToMinigunDriver.moveInputScale = 1f;
swapToMinigunDriver.driverUpdateTimerOverride = -1f;
swapToMinigunDriver.buttonPressType = AISkillDriver.ButtonPressType.Hold;
swapToMinigunDriver.minTargetHealthFraction = Mathf.NegativeInfinity;
swapToMinigunDriver.maxTargetHealthFraction = Mathf.Infinity;
swapToMinigunDriver.minUserHealthFraction = Mathf.NegativeInfinity;
swapToMinigunDriver.maxUserHealthFraction = Mathf.Infinity;
swapToMinigunDriver.skillSlot = SkillSlot.Special;
swapToMinigunDriver.requiredSkill = shieldEnterDef;
AISkillDriver shieldBashDriver = doppelganger.AddComponent<AISkillDriver>();
shieldBashDriver.customName = "ShieldBash";
shieldBashDriver.movementType = AISkillDriver.MovementType.ChaseMoveTarget;
shieldBashDriver.moveTargetType = AISkillDriver.TargetType.CurrentEnemy;
shieldBashDriver.activationRequiresAimConfirmation = false;
shieldBashDriver.activationRequiresTargetLoS = false;
shieldBashDriver.selectionRequiresTargetLoS = false;
shieldBashDriver.maxDistance = 6f;
shieldBashDriver.minDistance = 0f;
shieldBashDriver.requireSkillReady = true;
shieldBashDriver.aimType = AISkillDriver.AimType.AtCurrentEnemy;
shieldBashDriver.ignoreNodeGraph = true;
shieldBashDriver.moveInputScale = 1f;
shieldBashDriver.driverUpdateTimerOverride = -1f;
shieldBashDriver.buttonPressType = AISkillDriver.ButtonPressType.Hold;
shieldBashDriver.minTargetHealthFraction = Mathf.NegativeInfinity;
shieldBashDriver.maxTargetHealthFraction = Mathf.Infinity;
shieldBashDriver.minUserHealthFraction = Mathf.NegativeInfinity;
shieldBashDriver.maxUserHealthFraction = Mathf.Infinity;
shieldBashDriver.skillSlot = SkillSlot.Secondary;
//shieldBashDriver.requiredSkill = shieldUpDef;
AISkillDriver shieldFireDriver = doppelganger.AddComponent<AISkillDriver>();
shieldFireDriver.customName = "StandAndShoot";
shieldFireDriver.movementType = AISkillDriver.MovementType.Stop;
shieldFireDriver.moveTargetType = AISkillDriver.TargetType.CurrentEnemy;
shieldFireDriver.activationRequiresAimConfirmation = true;
shieldFireDriver.activationRequiresTargetLoS = false;
shieldFireDriver.selectionRequiresTargetLoS = false;
shieldFireDriver.maxDistance = 16f;
shieldFireDriver.minDistance = 0f;
shieldFireDriver.requireSkillReady = true;
shieldFireDriver.aimType = AISkillDriver.AimType.AtCurrentEnemy;
shieldFireDriver.ignoreNodeGraph = true;
shieldFireDriver.moveInputScale = 1f;
shieldFireDriver.driverUpdateTimerOverride = -1f;
shieldFireDriver.buttonPressType = AISkillDriver.ButtonPressType.Hold;
shieldFireDriver.minTargetHealthFraction = Mathf.NegativeInfinity;
shieldFireDriver.maxTargetHealthFraction = Mathf.Infinity;
shieldFireDriver.minUserHealthFraction = Mathf.NegativeInfinity;
shieldFireDriver.maxUserHealthFraction = Mathf.Infinity;
shieldFireDriver.skillSlot = SkillSlot.Primary;
//shieldFireDriver.requiredSkill = shieldUpDef;
AISkillDriver noShieldFireDriver = doppelganger.AddComponent<AISkillDriver>();
noShieldFireDriver.customName = "StrafeAndShoot";
noShieldFireDriver.movementType = AISkillDriver.MovementType.StrafeMovetarget;
noShieldFireDriver.moveTargetType = AISkillDriver.TargetType.CurrentEnemy;
noShieldFireDriver.activationRequiresAimConfirmation = true;
noShieldFireDriver.activationRequiresTargetLoS = false;
noShieldFireDriver.selectionRequiresTargetLoS = false;
noShieldFireDriver.maxDistance = 40f;
noShieldFireDriver.minDistance = 8f;
noShieldFireDriver.requireSkillReady = true;
noShieldFireDriver.aimType = AISkillDriver.AimType.AtCurrentEnemy;
noShieldFireDriver.ignoreNodeGraph = false;
noShieldFireDriver.moveInputScale = 1f;
noShieldFireDriver.driverUpdateTimerOverride = -1f;
noShieldFireDriver.buttonPressType = AISkillDriver.ButtonPressType.Hold;
noShieldFireDriver.minTargetHealthFraction = Mathf.NegativeInfinity;
noShieldFireDriver.maxTargetHealthFraction = Mathf.Infinity;
noShieldFireDriver.minUserHealthFraction = Mathf.NegativeInfinity;
noShieldFireDriver.maxUserHealthFraction = Mathf.Infinity;
noShieldFireDriver.skillSlot = SkillSlot.Primary;
//noShieldFireDriver.requiredSkill = shieldDownDef;
AISkillDriver followDriver = doppelganger.AddComponent<AISkillDriver>();
followDriver.customName = "Chase";
followDriver.movementType = AISkillDriver.MovementType.ChaseMoveTarget;
followDriver.moveTargetType = AISkillDriver.TargetType.CurrentEnemy;
followDriver.activationRequiresAimConfirmation = false;
followDriver.activationRequiresTargetLoS = false;
followDriver.maxDistance = Mathf.Infinity;
followDriver.minDistance = 0f;
followDriver.aimType = AISkillDriver.AimType.AtMoveTarget;
followDriver.ignoreNodeGraph = false;
followDriver.moveInputScale = 1f;
followDriver.driverUpdateTimerOverride = -1f;
followDriver.buttonPressType = AISkillDriver.ButtonPressType.Hold;
followDriver.minTargetHealthFraction = Mathf.NegativeInfinity;
followDriver.maxTargetHealthFraction = Mathf.Infinity;
followDriver.minUserHealthFraction = Mathf.NegativeInfinity;
followDriver.maxUserHealthFraction = Mathf.Infinity;
followDriver.skillSlot = SkillSlot.None;
Modules.Content.AddMasterPrefab(doppelganger);
CharacterMaster master = doppelganger.GetComponent<CharacterMaster>();
master.bodyPrefab = bodyPrefab;
}
#endregion
#region content
public override void InitializeUnlockables() {
//moved to awake
//EnforcerUnlockables.RegisterUnlockables();
}
public override void InitializeSkins() {
Skins.RegisterSkins();
}
#endregion
}
}