Skip to content

Commit

Permalink
move secondary back above primary
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTimeSweeper committed Jan 17, 2024
1 parent deeca2b commit f103a45
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions HenryMod/Characters/Survivors/Henry/HenrySurvivor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,34 @@ public override void InitializeEntityStateMachines()
public override void InitializeSkills()
{
Skills.CreateSkillFamilies(bodyPrefab);
AddPrmarySkills();
AddPrimarySkills();
AddSecondarySkills();
AddUtiitySkills();
AddSpecialSkills();
}

//let's look at secondary before primary because it is simpler
//if this is your first look at skilldef creation, take a look at Secondary first
private void AddPrimarySkills()
{
//the primary skill is created using a constructor for a typical primary
//it is also a SteppedSkillDef. Custom Skilldefs are very useful for custom behaviors related to casting a skill. see ror2's different skilldefs for reference
SteppedSkillDef slashSkillDef = Skills.CreateSkillDef<SteppedSkillDef>(new SkillDefInfo
(
"HenrySlash",
HENRY_PREFIX + "PRIMARY_SLASH_NAME",
HENRY_PREFIX + "PRIMARY_SLASH_DESCRIPTION",
assetBundle.LoadAsset<Sprite>("texPrimaryIcon"),
new EntityStates.SerializableEntityStateType(typeof(SkillStates.SlashCombo)),
"Weapon",
true
));
//custom Skilldefs can have additional fields that you can set manually
slashSkillDef.stepCount = 2;
slashSkillDef.stepGraceDuration = 0.5f;

Skills.AddPrimarySkills(bodyPrefab, slashSkillDef);
}

private void AddSecondarySkills()
{
//here is a basic skill def with all fields accounted for
Expand Down Expand Up @@ -197,27 +218,6 @@ private void AddSecondarySkills()
Skills.AddSecondarySkills(bodyPrefab, gunSkillDef);
}

private void AddPrmarySkills()
{
//the primary skill is created using a constructor for a typical primary
//it is also a SteppedSkillDef. Custom Skilldefs are very useful for custom behaviors related to casting a skill. see ror2's different skilldefs for reference
SteppedSkillDef slashSkillDef = Skills.CreateSkillDef<SteppedSkillDef>(new SkillDefInfo
(
"HenrySlash",
HENRY_PREFIX + "PRIMARY_SLASH_NAME",
HENRY_PREFIX + "PRIMARY_SLASH_DESCRIPTION",
assetBundle.LoadAsset<Sprite>("texPrimaryIcon"),
new EntityStates.SerializableEntityStateType(typeof(SkillStates.SlashCombo)),
"Weapon",
true
));
//custom Skilldefs can have additional fields that you can set manually
slashSkillDef.stepCount = 2;
slashSkillDef.stepGraceDuration = 0.5f;

Skills.AddPrimarySkills(bodyPrefab, slashSkillDef);
}

private void AddUtiitySkills()
{
//here's a skilldef of a typical movement skill. some fields are omitted and will just have default values
Expand Down Expand Up @@ -255,8 +255,8 @@ private void AddSpecialSkills()
skillIcon = assetBundle.LoadAsset<Sprite>("texSpecialIcon"),

activationState = new EntityStates.SerializableEntityStateType(typeof(SkillStates.ThrowBomb)),
activationStateMachineName = "Weapon2", //setting this to the "weapon2" EntityStateMachine allows us to cast this skill at the same time primary, which is set to the "weapon" EntityStateMachine
interruptPriority = EntityStates.InterruptPriority.Skill,
//setting this to the "weapon2" EntityStateMachine allows us to cast this skill at the same time primary, which is set to the "weapon" EntityStateMachine
activationStateMachineName = "Weapon2", interruptPriority = EntityStates.InterruptPriority.Skill,

baseMaxStock = 1,
baseRechargeInterval = 10f,
Expand Down

0 comments on commit f103a45

Please sign in to comment.