119 changed files with 29070 additions and 1077 deletions
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: AshBeetle |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: skullGuardian |
||||
|
enemyIcon: {fileID: 21300000, guid: bd8f3094e7ef01148bddd857e065ebc3, type: 3} |
||||
|
stepRange: 3 |
||||
|
stepRangeMultiplier: 1 |
||||
|
speed: 1 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 7 |
||||
|
maxHP: 12 |
||||
|
currentHP: 12 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 5 |
||||
|
attackRange: 1 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: f3b1b010998041142826272011c50414 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: BlastFistMushroom |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: HoodWanderer |
||||
|
enemyIcon: {fileID: 21300000, guid: 99d6cfcd8d628454989abc09534f0b64, type: 3} |
||||
|
stepRange: 4 |
||||
|
stepRangeMultiplier: 1 |
||||
|
speed: 2 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 0 |
||||
|
maxHP: 48 |
||||
|
currentHP: 48 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 4 |
||||
|
attackRange: 1 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: c122b87da214436469b174488c400c23 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: Bone |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: HoodWanderer |
||||
|
enemyIcon: {fileID: 21300000, guid: 99d6cfcd8d628454989abc09534f0b64, type: 3} |
||||
|
stepRange: 0 |
||||
|
stepRangeMultiplier: 0 |
||||
|
speed: 2 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 0 |
||||
|
maxHP: 1 |
||||
|
currentHP: 1 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 0 |
||||
|
attackRange: 1 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: fd4da5e8a3da1e64ea634a030cf9d266 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: CorrosiveSludge |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: HoodWanderer |
||||
|
enemyIcon: {fileID: 21300000, guid: 99d6cfcd8d628454989abc09534f0b64, type: 3} |
||||
|
stepRange: 4 |
||||
|
stepRangeMultiplier: 1 |
||||
|
speed: 2 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 0 |
||||
|
maxHP: 30 |
||||
|
currentHP: 30 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 7 |
||||
|
attackRange: 1 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 05f713823d4884e46ba851f25df21285 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: DrowsyShroom |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: HoodWanderer |
||||
|
enemyIcon: {fileID: 21300000, guid: 99d6cfcd8d628454989abc09534f0b64, type: 3} |
||||
|
stepRange: 4 |
||||
|
stepRangeMultiplier: 1 |
||||
|
speed: 2 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 0 |
||||
|
maxHP: 15 |
||||
|
currentHP: 15 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 4 |
||||
|
attackRange: 1 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: cb99d0b48fab03c478afff5810b2b77d |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: EmberWraith |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: HoodWanderer |
||||
|
enemyIcon: {fileID: 21300000, guid: 99d6cfcd8d628454989abc09534f0b64, type: 3} |
||||
|
stepRange: 4 |
||||
|
stepRangeMultiplier: 1 |
||||
|
speed: 2 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 0 |
||||
|
maxHP: 38 |
||||
|
currentHP: 38 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 10 |
||||
|
attackRange: 1 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: a89070f0aaf0c7a4fb3af1a1a4470107 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: ParasiticMushroom |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: HoodWanderer |
||||
|
enemyIcon: {fileID: 21300000, guid: 99d6cfcd8d628454989abc09534f0b64, type: 3} |
||||
|
stepRange: 4 |
||||
|
stepRangeMultiplier: 1 |
||||
|
speed: 2 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 0 |
||||
|
maxHP: 20 |
||||
|
currentHP: 20 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 6 |
||||
|
attackRange: 1 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: f5d3af83e6bdb834ba52a5bf19c0878e |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: RE_SkullGuardian |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: HoodWanderer |
||||
|
enemyIcon: {fileID: 21300000, guid: 99d6cfcd8d628454989abc09534f0b64, type: 3} |
||||
|
stepRange: 4 |
||||
|
stepRangeMultiplier: 1 |
||||
|
speed: 2 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 0 |
||||
|
maxHP: 8 |
||||
|
currentHP: 8 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 5 |
||||
|
attackRange: 1 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 5630b512cc511e04183d23697c407f37 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: RE_SkullMage |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: HoodWanderer |
||||
|
enemyIcon: {fileID: 21300000, guid: 99d6cfcd8d628454989abc09534f0b64, type: 3} |
||||
|
stepRange: 4 |
||||
|
stepRangeMultiplier: 1 |
||||
|
speed: 2 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 0 |
||||
|
maxHP: 6 |
||||
|
currentHP: 6 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 4 |
||||
|
attackRange: 3 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 39d8df1bed9c68e4c9cc64cdf94f6145 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: RE_SkullWarlock |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: HoodWanderer |
||||
|
enemyIcon: {fileID: 21300000, guid: 99d6cfcd8d628454989abc09534f0b64, type: 3} |
||||
|
stepRange: 4 |
||||
|
stepRangeMultiplier: 1 |
||||
|
speed: 2 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 0 |
||||
|
maxHP: 5 |
||||
|
currentHP: 5 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 5 |
||||
|
attackRange: 3 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: b1a39596f1aabfc4b9f0901eccb44366 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: ShatteringFistMushroom |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: HoodWanderer |
||||
|
enemyIcon: {fileID: 21300000, guid: 99d6cfcd8d628454989abc09534f0b64, type: 3} |
||||
|
stepRange: 4 |
||||
|
stepRangeMultiplier: 1 |
||||
|
speed: 2 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 0 |
||||
|
maxHP: 38 |
||||
|
currentHP: 38 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 12 |
||||
|
attackRange: 1 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: d3a043d7961329c42b27d2aa5f6be3fe |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: SkullMage |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: HoodWanderer |
||||
|
enemyIcon: {fileID: 21300000, guid: 99d6cfcd8d628454989abc09534f0b64, type: 3} |
||||
|
stepRange: 4 |
||||
|
stepRangeMultiplier: 1 |
||||
|
speed: 2 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 0 |
||||
|
maxHP: 11 |
||||
|
currentHP: 11 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 4 |
||||
|
attackRange: 3 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: b0b09cece064a9a45a5770e45c9d77be |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,32 @@ |
|||||
|
%YAML 1.1 |
||||
|
%TAG !u! tag:unity3d.com,2011: |
||||
|
--- !u!114 &11400000 |
||||
|
MonoBehaviour: |
||||
|
m_ObjectHideFlags: 0 |
||||
|
m_CorrespondingSourceObject: {fileID: 0} |
||||
|
m_PrefabInstance: {fileID: 0} |
||||
|
m_PrefabAsset: {fileID: 0} |
||||
|
m_GameObject: {fileID: 0} |
||||
|
m_Enabled: 1 |
||||
|
m_EditorHideFlags: 0 |
||||
|
m_Script: {fileID: 11500000, guid: 20f70984b262f8d4382bf5262dddb83e, type: 3} |
||||
|
m_Name: SkullWarlock |
||||
|
m_EditorClassIdentifier: |
||||
|
enemyName: HoodWanderer |
||||
|
enemyIcon: {fileID: 21300000, guid: 99d6cfcd8d628454989abc09534f0b64, type: 3} |
||||
|
stepRange: 4 |
||||
|
stepRangeMultiplier: 1 |
||||
|
speed: 2 |
||||
|
maxMoveCoolDown: 0 |
||||
|
currentMoveCoolDown: 0 |
||||
|
shieldValue: 0 |
||||
|
upShieldValue: 0 |
||||
|
maxHP: 9 |
||||
|
currentHP: 9 |
||||
|
sufferDamageMultiply: 1 |
||||
|
colourType: 0 |
||||
|
maxSkillCoolDown: 3 |
||||
|
currentSkillCoolDown: 3 |
||||
|
damageMultiplier: 1 |
||||
|
damage: 5 |
||||
|
attackRange: 3 |
||||
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 9bfb635e9a74e0a40897f1015c398345 |
||||
|
NativeFormatImporter: |
||||
|
externalObjects: {} |
||||
|
mainObjectFileID: 11400000 |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: faed8b26a4858c34290ecb341e8eeacd |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 800c0767dc4bcc646a3a10d99143a0e2 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 5a133951e41a4ec43a57bc107e44f87e |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 8a24262c2ec3f9a45919642911da8010 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 71195df257cd2c84f8e1df758c1dcf58 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 8ca81c0623a2728438d77e48fb2e9617 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 7e3e5773e30caab47b324c8549d3aea1 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 0b40e87c6ef35fd4ab0e637458b0898d |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 324f36d654c1ae14fa302874c914d861 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: a2d780b42e1e8544784a6c3fbad33b85 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 3b3460a2f85e4af418b1fd504711dac7 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 75eed9d1e1f05bb42b86c70a9cb083c1 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 2d5c0f23ba223494b90357f5d63672a8 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: ff5ce56410d61cf47b6c413f60931031 |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
File diff suppressed because it is too large
@ -0,0 +1,7 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 3a8511131a3f5264ea3ee4414725e76c |
||||
|
PrefabImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,213 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class AshBeetle : MonoBehaviour |
||||
|
{ |
||||
|
EnemyNode enemyNode; |
||||
|
|
||||
|
[Header("计数标量")] |
||||
|
public float time; |
||||
|
float lastTime = 0; |
||||
|
[Header("移动速度标量")] |
||||
|
public float moveSpeed; |
||||
|
|
||||
|
//怪物行动
|
||||
|
public EnemyAction enemyAction; |
||||
|
|
||||
|
public Dictionary<EnemyAction, float> actionPool = new Dictionary<EnemyAction, float>() |
||||
|
{ |
||||
|
{ new EnemyActionAction_Attack(), 0.7f }, |
||||
|
{ new EnemyAction_Weak(), 0.3f } |
||||
|
}; |
||||
|
|
||||
|
private void Start() |
||||
|
{ |
||||
|
enemyNode = GetComponent<EnemyNode>(); |
||||
|
} |
||||
|
|
||||
|
private void Update() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
public void enemyTurn() |
||||
|
{ |
||||
|
|
||||
|
StartCoroutine(JudgNextActionCoroutine()); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
|
||||
|
{ |
||||
|
Debug.Log("真正行动是:" + enemyAction); |
||||
|
switch (enemyAction) |
||||
|
{ |
||||
|
case EnemyActionAction_Attack: |
||||
|
yield return StartCoroutine(MeleeAttackAction()); |
||||
|
break; |
||||
|
case EnemyAction_Weak: |
||||
|
yield return StartCoroutine(WeakAttackAction()); |
||||
|
break; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator JudgNextActionCoroutine() |
||||
|
{ |
||||
|
if (enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.sleep)) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(JudgeActionCoroutine()); |
||||
|
} |
||||
|
|
||||
|
//让下一个敌人运动
|
||||
|
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing; |
||||
|
} |
||||
|
|
||||
|
IEnumerator MeleeAttackAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator WeakAttackAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.weak, 1); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.weak, 1); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveTowardsPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathTowardsPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
private int getMoveStep() |
||||
|
{ |
||||
|
if (enemyNode.getStepRange() + 1 <= enemyNode.pasth.Count) |
||||
|
{ |
||||
|
return enemyNode.getStepRange() + 1; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
return enemyNode.pasth.Count; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public void ChooseAction() |
||||
|
{ |
||||
|
enemyAction = new EnemyActionAction_Shoot(); |
||||
|
enemyAction = enemyNode.GetRandomAction(actionPool); |
||||
|
Debug.Log("行动是:" + enemyAction); |
||||
|
enemyNode.enemyUIBar.SwitchIntention(enemyAction); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
IEnumerator moveOneStep(MapUnity nexMapUnity) |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
MapUnity disNode = nexMapUnity; |
||||
|
currentNode.blocked = false; |
||||
|
currentNode.enemyNode = null; |
||||
|
enemyNode.positionX = disNode.locationX; |
||||
|
enemyNode.positionY = disNode.locationY; |
||||
|
disNode.enemyNode = enemyNode; |
||||
|
yield return StartCoroutine(SkullGuardianMoveCoroutine(disNode)); |
||||
|
} |
||||
|
IEnumerator SkullGuardianMoveCoroutine( MapUnity endMapUnity )//移动到位置
|
||||
|
{ |
||||
|
while ( true ) |
||||
|
{ |
||||
|
float dDistance = Vector3.Distance(this.gameObject.transform.position, endMapUnity.transform.position); |
||||
|
|
||||
|
if(dDistance < 0.1f) |
||||
|
{ |
||||
|
break; |
||||
|
} |
||||
|
this.gameObject .transform .position = Vector3.Lerp(this.gameObject.transform.position, endMapUnity.transform.position, Time.deltaTime * moveSpeed); |
||||
|
|
||||
|
yield return 0; |
||||
|
} |
||||
|
|
||||
|
//判断腐蚀
|
||||
|
enemyNode.CorrodeRealize(endMapUnity); |
||||
|
yield break; |
||||
|
} |
||||
|
|
||||
|
public void NextTurnIntention() |
||||
|
{ |
||||
|
|
||||
|
if (enemyNode.pasth.Count <= 1) |
||||
|
{ |
||||
|
enemyNode.canMove = false; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
enemyNode.canMove = true; |
||||
|
} |
||||
|
|
||||
|
if(enemyNode .EnemyState .currentSkillCoolDown <=0) |
||||
|
{ |
||||
|
enemyNode.planAction = EnemyNode.PlanAction.sheield; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
enemyNode.planAction = EnemyNode.PlanAction.attack; |
||||
|
enemyNode.canLineAppre = true; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void AttackDamage() |
||||
|
{ |
||||
|
Usermanager.Instance.SufferDamage(enemyNode.DamageCalculation(enemyNode.EnemyState.damage),enemyNode); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 159aa5c40181a574ea93a2306670a2c8 |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,242 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class BlastFistMushroom : MonoBehaviour |
||||
|
{ |
||||
|
EnemyNode enemyNode; |
||||
|
|
||||
|
[Header("瞄准射线图层剔除")] |
||||
|
public LayerMask layerMask; |
||||
|
|
||||
|
[Header("计数标量")] |
||||
|
public float time; |
||||
|
float lastTime = 0; |
||||
|
[Header("移动速度标量")] |
||||
|
public float moveSpeed; |
||||
|
//怪物行动
|
||||
|
public EnemyAction enemyAction; |
||||
|
|
||||
|
public Dictionary<EnemyAction, float> actionPool = new Dictionary<EnemyAction, float>() |
||||
|
{ |
||||
|
{ new EnemyAction_Nothing(), 0.5f }, |
||||
|
{ new EnemyActionAction_Attack(), 0.5f } |
||||
|
}; |
||||
|
|
||||
|
private void Start() |
||||
|
{ |
||||
|
enemyNode = GetComponent<EnemyNode>(); |
||||
|
} |
||||
|
|
||||
|
private void Update() |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void enemyTurn() |
||||
|
{ |
||||
|
StartCoroutine(JudgNextActionCoroutine()); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void ChooseAction() |
||||
|
{ |
||||
|
enemyAction = new EnemyActionAction_Attack(); |
||||
|
enemyAction = enemyNode.GetRandomAction(actionPool); |
||||
|
Debug.Log("行动是:" + enemyAction); |
||||
|
enemyNode.enemyUIBar.SwitchIntention(enemyAction); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
|
||||
|
{ |
||||
|
Debug.Log("真正行动是:" + enemyAction); |
||||
|
switch (enemyAction) |
||||
|
{ |
||||
|
case EnemyActionAction_Attack: |
||||
|
yield return StartCoroutine(MeleeAttackAction()); |
||||
|
break; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
IEnumerator MeleeAttackAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public void RandomPollute(HashSet<MapUnity> set, int num) |
||||
|
{ |
||||
|
HashSet<MapUnity> randomNodes = MathTool.GetRandomElements(set, num); |
||||
|
foreach (var node in randomNodes) |
||||
|
{ |
||||
|
node.whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
} |
||||
|
GameManager.Instance.SyncColourCountUI(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
IEnumerator moveTowardsPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathTowardsPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveAwayFromPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathAwayFromPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private int getMoveStep() |
||||
|
{ |
||||
|
if (enemyNode.getStepRange() + 1 <= enemyNode.pasth.Count) |
||||
|
{ |
||||
|
return enemyNode.getStepRange() + 1; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
return enemyNode.pasth.Count; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveOneStep(MapUnity nexMapUnity) |
||||
|
{ |
||||
|
enemyNode.bleedCal(); |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
MapUnity disNode = nexMapUnity; |
||||
|
currentNode.blocked = false; |
||||
|
currentNode.enemyNode = null; |
||||
|
enemyNode.positionX = disNode.locationX; |
||||
|
enemyNode.positionY = disNode.locationY; |
||||
|
disNode.enemyNode = enemyNode; |
||||
|
yield return StartCoroutine(SkeletonArcherMoveCoroutine(disNode)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgNextActionCoroutine() |
||||
|
{ |
||||
|
if (enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.sleep)) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(JudgeActionCoroutine()); |
||||
|
} |
||||
|
//下回合意图
|
||||
|
ArcherAim(); |
||||
|
|
||||
|
//让下一个敌人运动
|
||||
|
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing; |
||||
|
} |
||||
|
IEnumerator SkeletonArcherMoveCoroutine(MapUnity endMapUnity)//移动到位置
|
||||
|
{ |
||||
|
while (true) |
||||
|
{ |
||||
|
float dDistance = Vector3.Distance(this.gameObject.transform.position, endMapUnity.transform.position); |
||||
|
|
||||
|
if (dDistance < 0.1f) |
||||
|
{ |
||||
|
break; |
||||
|
} |
||||
|
this.gameObject.transform.position = Vector3.Lerp(this.gameObject.transform.position, endMapUnity.transform.position, Time.deltaTime * moveSpeed); |
||||
|
|
||||
|
yield return 0; |
||||
|
} |
||||
|
|
||||
|
//判断腐蚀
|
||||
|
enemyNode.CorrodeRealize(endMapUnity); |
||||
|
yield break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
public void ArcherColour(MapUnity currentNode) |
||||
|
{ |
||||
|
List<MapUnity> toColourPool = new List<MapUnity>(); |
||||
|
|
||||
|
if (currentNode.blocked == false) |
||||
|
toColourPool.Add(currentNode); |
||||
|
|
||||
|
for (int i = 0; i < currentNode.unitPool.Count; i++) |
||||
|
{ |
||||
|
if (currentNode.unitPool[i] != null && currentNode.unitPool[i].blocked == false) |
||||
|
{ |
||||
|
toColourPool.Add(currentNode.unitPool[i]); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
for (int c = 0; c < toColourPool.Count; c++) |
||||
|
{ |
||||
|
if (toColourPool.Count > 0) |
||||
|
{ |
||||
|
toColourPool[c].whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
if (toColourPool[c].playerOn) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public void ArcherAim() |
||||
|
{ |
||||
|
Vector3 dir = GameManager.Instance.player.transform.position - this.transform.position; |
||||
|
Ray ray = new Ray(this.transform.position, dir); |
||||
|
if (Physics.Raycast(ray, out RaycastHit raycastHit, 500, layerMask.value)) |
||||
|
{ |
||||
|
enemyNode.lineAim.GetComponent<EnemyAimLine>().aimGamgObject = raycastHit.collider.gameObject; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void AttackDamage() |
||||
|
{ |
||||
|
int damage = GameManager.Instance.getNodeDiffForEnemy(); |
||||
|
MathTool.keepNature(damage); |
||||
|
Usermanager.Instance.SufferDamage(enemyNode.DamageCalculation(damage), enemyNode); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 55c67188084c0884a843685cc2343e6e |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,73 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class Bone : MonoBehaviour |
||||
|
{ |
||||
|
EnemyNode enemyNode; |
||||
|
|
||||
|
[Header("计数标量")] |
||||
|
public float time; |
||||
|
float lastTime = 0; |
||||
|
[Header("移动速度标量")] |
||||
|
public float moveSpeed; |
||||
|
|
||||
|
//怪物行动
|
||||
|
public EnemyAction enemyAction; |
||||
|
|
||||
|
public int reTurn = 0; |
||||
|
|
||||
|
public Dictionary<EnemyAction, float> actionPool = new Dictionary<EnemyAction, float>() |
||||
|
{ |
||||
|
{ new EnemyAction_Nothing(), 1.0f } |
||||
|
}; |
||||
|
|
||||
|
private void Start() |
||||
|
{ |
||||
|
enemyNode = GetComponent<EnemyNode>(); |
||||
|
} |
||||
|
|
||||
|
private void Update() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void ChooseAction() |
||||
|
{ |
||||
|
enemyAction = new EnemyAction_Nothing(); |
||||
|
Debug.Log("行动是:" + enemyAction); |
||||
|
enemyNode.enemyUIBar.SwitchIntention(enemyAction); |
||||
|
|
||||
|
} |
||||
|
public void enemyTurn() |
||||
|
{ |
||||
|
|
||||
|
StartCoroutine(JudgNextActionCoroutine()); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
|
||||
|
{ |
||||
|
Debug.Log("真正行动是:" + enemyAction); |
||||
|
reTurn += 1; |
||||
|
|
||||
|
if (reTurn == 2) |
||||
|
{ |
||||
|
EnemyManager.Instance.enemyCount += 1; |
||||
|
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing; |
||||
|
enemyNode.boneOnDeath(); |
||||
|
yield break; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator JudgNextActionCoroutine() |
||||
|
{ |
||||
|
yield return StartCoroutine(JudgeActionCoroutine()); |
||||
|
|
||||
|
//让下一个敌人运动
|
||||
|
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 1127cf5fcca27ba4c9d86bf4d1bffce8 |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,260 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class CorrosiveSludge : MonoBehaviour |
||||
|
{ |
||||
|
EnemyNode enemyNode; |
||||
|
|
||||
|
[Header("瞄准射线图层剔除")] |
||||
|
public LayerMask layerMask; |
||||
|
|
||||
|
[Header("计数标量")] |
||||
|
public float time; |
||||
|
float lastTime = 0; |
||||
|
[Header("移动速度标量")] |
||||
|
public float moveSpeed; |
||||
|
//怪物行动
|
||||
|
public EnemyAction enemyAction; |
||||
|
|
||||
|
public Dictionary<EnemyAction, float> actionPool = new Dictionary<EnemyAction, float>() |
||||
|
{ |
||||
|
{ new EnemyActionAction_Aoe(), 0.6f }, |
||||
|
{ new EnemyActionAction_Attack(), 0.4f } |
||||
|
}; |
||||
|
|
||||
|
private void Start() |
||||
|
{ |
||||
|
enemyNode = GetComponent<EnemyNode>(); |
||||
|
} |
||||
|
|
||||
|
private void Update() |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void enemyTurn() |
||||
|
{ |
||||
|
StartCoroutine(JudgNextActionCoroutine()); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void ChooseAction() |
||||
|
{ |
||||
|
enemyAction = new EnemyActionAction_Attack(); |
||||
|
enemyAction = enemyNode.GetRandomAction(actionPool); |
||||
|
Debug.Log("行动是:" + enemyAction); |
||||
|
enemyNode.enemyUIBar.SwitchIntention(enemyAction); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
|
||||
|
{ |
||||
|
Debug.Log("真正行动是:" + enemyAction); |
||||
|
switch (enemyAction) |
||||
|
{ |
||||
|
case EnemyActionAction_Aoe: |
||||
|
yield return StartCoroutine(SkillAction()); |
||||
|
break; |
||||
|
case EnemyActionAction_Attack: |
||||
|
yield return StartCoroutine(MeleeAttackAction()); |
||||
|
break; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
public void RandomPollute(HashSet<MapUnity> set, int num) |
||||
|
{ |
||||
|
HashSet<MapUnity> randomNodes = MathTool.GetRandomElements(set, num); |
||||
|
foreach (var node in randomNodes) |
||||
|
{ |
||||
|
node.whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
} |
||||
|
GameManager.Instance.SyncColourCountUI(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
IEnumerator moveTowardsPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathTowardsPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveAwayFromPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathAwayFromPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private int getMoveStep() |
||||
|
{ |
||||
|
if (enemyNode.getStepRange() + 1 <= enemyNode.pasth.Count) |
||||
|
{ |
||||
|
return enemyNode.getStepRange() + 1; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
return enemyNode.pasth.Count; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveOneStep(MapUnity nexMapUnity) |
||||
|
{ |
||||
|
enemyNode.bleedCal(); |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
MapUnity disNode = nexMapUnity; |
||||
|
currentNode.blocked = false; |
||||
|
currentNode.enemyNode = null; |
||||
|
enemyNode.positionX = disNode.locationX; |
||||
|
enemyNode.positionY = disNode.locationY; |
||||
|
disNode.enemyNode = enemyNode; |
||||
|
yield return StartCoroutine(SkeletonArcherMoveCoroutine(disNode)); |
||||
|
} |
||||
|
|
||||
|
IEnumerator MeleeAttackAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator SkillAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
HashSet<MapUnity> targetSet= new HashSet<MapUnity>(); |
||||
|
targetSet.Add(currentNode); |
||||
|
getNodeTools.getCircleNode(targetSet,1); |
||||
|
getNodeTools.RandomPollute(targetSet,4); |
||||
|
foreach (MapUnity target in targetSet) |
||||
|
{ |
||||
|
if (target.Equals(GameManager.Instance.playerOn)) |
||||
|
{ |
||||
|
Usermanager.Instance.SufferDamage(enemyNode.DamageCalculation(8), enemyNode); |
||||
|
} |
||||
|
} |
||||
|
yield break; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgNextActionCoroutine() |
||||
|
{ |
||||
|
if (enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.sleep)) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(JudgeActionCoroutine()); |
||||
|
} |
||||
|
//下回合意图
|
||||
|
ArcherAim(); |
||||
|
|
||||
|
//让下一个敌人运动
|
||||
|
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing; |
||||
|
} |
||||
|
IEnumerator SkeletonArcherMoveCoroutine(MapUnity endMapUnity)//移动到位置
|
||||
|
{ |
||||
|
while (true) |
||||
|
{ |
||||
|
float dDistance = Vector3.Distance(this.gameObject.transform.position, endMapUnity.transform.position); |
||||
|
|
||||
|
if (dDistance < 0.1f) |
||||
|
{ |
||||
|
break; |
||||
|
} |
||||
|
this.gameObject.transform.position = Vector3.Lerp(this.gameObject.transform.position, endMapUnity.transform.position, Time.deltaTime * moveSpeed); |
||||
|
|
||||
|
yield return 0; |
||||
|
} |
||||
|
|
||||
|
//判断腐蚀
|
||||
|
enemyNode.CorrodeRealize(endMapUnity); |
||||
|
yield break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
public void ArcherColour(MapUnity currentNode) |
||||
|
{ |
||||
|
List<MapUnity> toColourPool = new List<MapUnity>(); |
||||
|
|
||||
|
if (currentNode.blocked == false) |
||||
|
toColourPool.Add(currentNode); |
||||
|
|
||||
|
for (int i = 0; i < currentNode.unitPool.Count; i++) |
||||
|
{ |
||||
|
if (currentNode.unitPool[i] != null && currentNode.unitPool[i].blocked == false) |
||||
|
{ |
||||
|
toColourPool.Add(currentNode.unitPool[i]); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
for (int c = 0; c < toColourPool.Count; c++) |
||||
|
{ |
||||
|
if (toColourPool.Count > 0) |
||||
|
{ |
||||
|
toColourPool[c].whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
if (toColourPool[c].playerOn) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public void ArcherAim() |
||||
|
{ |
||||
|
Vector3 dir = GameManager.Instance.player.transform.position - this.transform.position; |
||||
|
Ray ray = new Ray(this.transform.position, dir); |
||||
|
if (Physics.Raycast(ray, out RaycastHit raycastHit, 500, layerMask.value)) |
||||
|
{ |
||||
|
enemyNode.lineAim.GetComponent<EnemyAimLine>().aimGamgObject = raycastHit.collider.gameObject; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void AttackDamage() |
||||
|
{ |
||||
|
Usermanager.Instance.SufferDamage(enemyNode.DamageCalculation(enemyNode.EnemyState.damage), enemyNode); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 80ff1cf9bf5e8df42a81bfd4e085df46 |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,248 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class DrowsyShroom : MonoBehaviour |
||||
|
{ |
||||
|
EnemyNode enemyNode; |
||||
|
|
||||
|
[Header("瞄准射线图层剔除")] |
||||
|
public LayerMask layerMask; |
||||
|
|
||||
|
[Header("计数标量")] |
||||
|
public float time; |
||||
|
float lastTime = 0; |
||||
|
[Header("移动速度标量")] |
||||
|
public float moveSpeed; |
||||
|
//怪物行动
|
||||
|
public EnemyAction enemyAction; |
||||
|
|
||||
|
public Dictionary<EnemyAction, float> actionPool = new Dictionary<EnemyAction, float>() |
||||
|
{ |
||||
|
{ new EnemyAction_Sleep(), 0.5f }, |
||||
|
{ new EnemyActionAction_Attack(), 0.5f } |
||||
|
}; |
||||
|
|
||||
|
private void Start() |
||||
|
{ |
||||
|
enemyNode = GetComponent<EnemyNode>(); |
||||
|
} |
||||
|
|
||||
|
private void Update() |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void enemyTurn() |
||||
|
{ |
||||
|
StartCoroutine(JudgNextActionCoroutine()); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void ChooseAction() |
||||
|
{ |
||||
|
enemyAction = new EnemyActionAction_Attack(); |
||||
|
enemyAction = enemyNode.GetRandomAction(actionPool); |
||||
|
Debug.Log("行动是:" + enemyAction); |
||||
|
enemyNode.enemyUIBar.SwitchIntention(enemyAction); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
|
||||
|
{ |
||||
|
Debug.Log("真正行动是:" + enemyAction); |
||||
|
switch (enemyAction) |
||||
|
{ |
||||
|
case EnemyAction_Sleep: |
||||
|
yield return StartCoroutine(SleepAction()); |
||||
|
break; |
||||
|
case EnemyActionAction_Attack: |
||||
|
yield return StartCoroutine(MeleeAttackAction()); |
||||
|
break; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
public void RandomPollute(HashSet<MapUnity> set, int num) |
||||
|
{ |
||||
|
HashSet<MapUnity> randomNodes = MathTool.GetRandomElements(set, num); |
||||
|
foreach (var node in randomNodes) |
||||
|
{ |
||||
|
node.whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
} |
||||
|
GameManager.Instance.SyncColourCountUI(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
IEnumerator moveTowardsPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathTowardsPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveAwayFromPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathAwayFromPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private int getMoveStep() |
||||
|
{ |
||||
|
if (enemyNode.getStepRange() + 1 <= enemyNode.pasth.Count) |
||||
|
{ |
||||
|
return enemyNode.getStepRange() + 1; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
return enemyNode.pasth.Count; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveOneStep(MapUnity nexMapUnity) |
||||
|
{ |
||||
|
enemyNode.bleedCal(); |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
MapUnity disNode = nexMapUnity; |
||||
|
currentNode.blocked = false; |
||||
|
currentNode.enemyNode = null; |
||||
|
enemyNode.positionX = disNode.locationX; |
||||
|
enemyNode.positionY = disNode.locationY; |
||||
|
disNode.enemyNode = enemyNode; |
||||
|
yield return StartCoroutine(SkeletonArcherMoveCoroutine(disNode)); |
||||
|
} |
||||
|
|
||||
|
IEnumerator MeleeAttackAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator SleepAction() |
||||
|
{ |
||||
|
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.levelSleep, 4); |
||||
|
yield break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgNextActionCoroutine() |
||||
|
{ |
||||
|
if (enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.sleep)) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(JudgeActionCoroutine()); |
||||
|
} |
||||
|
//下回合意图
|
||||
|
ArcherAim(); |
||||
|
|
||||
|
//让下一个敌人运动
|
||||
|
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing; |
||||
|
} |
||||
|
IEnumerator SkeletonArcherMoveCoroutine(MapUnity endMapUnity)//移动到位置
|
||||
|
{ |
||||
|
while (true) |
||||
|
{ |
||||
|
float dDistance = Vector3.Distance(this.gameObject.transform.position, endMapUnity.transform.position); |
||||
|
|
||||
|
if (dDistance < 0.1f) |
||||
|
{ |
||||
|
break; |
||||
|
} |
||||
|
this.gameObject.transform.position = Vector3.Lerp(this.gameObject.transform.position, endMapUnity.transform.position, Time.deltaTime * moveSpeed); |
||||
|
|
||||
|
yield return 0; |
||||
|
} |
||||
|
|
||||
|
//判断腐蚀
|
||||
|
enemyNode.CorrodeRealize(endMapUnity); |
||||
|
yield break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
public void ArcherColour(MapUnity currentNode) |
||||
|
{ |
||||
|
List<MapUnity> toColourPool = new List<MapUnity>(); |
||||
|
|
||||
|
if (currentNode.blocked == false) |
||||
|
toColourPool.Add(currentNode); |
||||
|
|
||||
|
for (int i = 0; i < currentNode.unitPool.Count; i++) |
||||
|
{ |
||||
|
if (currentNode.unitPool[i] != null && currentNode.unitPool[i].blocked == false) |
||||
|
{ |
||||
|
toColourPool.Add(currentNode.unitPool[i]); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
for (int c = 0; c < toColourPool.Count; c++) |
||||
|
{ |
||||
|
if (toColourPool.Count > 0) |
||||
|
{ |
||||
|
toColourPool[c].whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
if (toColourPool[c].playerOn) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public void ArcherAim() |
||||
|
{ |
||||
|
Vector3 dir = GameManager.Instance.player.transform.position - this.transform.position; |
||||
|
Ray ray = new Ray(this.transform.position, dir); |
||||
|
if (Physics.Raycast(ray, out RaycastHit raycastHit, 500, layerMask.value)) |
||||
|
{ |
||||
|
enemyNode.lineAim.GetComponent<EnemyAimLine>().aimGamgObject = raycastHit.collider.gameObject; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void AttackDamage() |
||||
|
{ |
||||
|
Usermanager.Instance.SufferDamage(enemyNode.DamageCalculation(enemyNode.EnemyState.damage), enemyNode); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 5020a3e65f711024bbf871c4b7f33988 |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,241 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class EmberWraith : MonoBehaviour |
||||
|
{ |
||||
|
EnemyNode enemyNode; |
||||
|
|
||||
|
[Header("瞄准射线图层剔除")] |
||||
|
public LayerMask layerMask; |
||||
|
|
||||
|
[Header("计数标量")] |
||||
|
public float time; |
||||
|
float lastTime = 0; |
||||
|
[Header("移动速度标量")] |
||||
|
public float moveSpeed; |
||||
|
//怪物行动
|
||||
|
public EnemyAction enemyAction; |
||||
|
|
||||
|
public Dictionary<EnemyAction, float> actionPool = new Dictionary<EnemyAction, float>() |
||||
|
{ |
||||
|
{ new EnemyActionAction_Attack(), 0.5f }, |
||||
|
{ new EnemyActionAction_Shield(), 0.5f } |
||||
|
}; |
||||
|
|
||||
|
private void Start() |
||||
|
{ |
||||
|
enemyNode = GetComponent<EnemyNode>(); |
||||
|
enemyNode.sufferAbnormalCondition(AbnormalCondition.flashPoint, 1); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
private void Update() |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
private void OnEnable() |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
public void enemyTurn() |
||||
|
{ |
||||
|
StartCoroutine(JudgNextActionCoroutine()); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void ChooseAction() |
||||
|
{ |
||||
|
enemyAction = new EnemyActionAction_Attack(); |
||||
|
enemyAction = enemyNode.GetRandomAction(actionPool); |
||||
|
Debug.Log("行动是:" + enemyAction); |
||||
|
enemyNode.enemyUIBar.SwitchIntention(enemyAction); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
|
||||
|
{ |
||||
|
Debug.Log("真正行动是:" + enemyAction); |
||||
|
switch (enemyAction) |
||||
|
{ |
||||
|
case EnemyActionAction_Attack: |
||||
|
yield return StartCoroutine(MeleeAttackAction()); |
||||
|
break; |
||||
|
case EnemyActionAction_Shield: |
||||
|
yield return StartCoroutine(ShieldAction()); |
||||
|
break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
IEnumerator MeleeAttackAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(enemyNode.EnemyState.damage); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(enemyNode.EnemyState.damage); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator ShieldAction() |
||||
|
{ |
||||
|
for (int i = 0; i < EnemyManager.Instance.enemySpeedSortingList.Count; i++) |
||||
|
{ |
||||
|
EnemyManager.Instance.enemySpeedSortingList[i].sufferAbnormalCondition(AbnormalCondition.angerUpperDamage, 3); |
||||
|
EnemyManager.Instance.enemySpeedSortingList[i].EnemyState.shieldValue += EnemyManager.Instance.enemySpeedSortingList[i].ShieldCalculation(7); |
||||
|
} |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public void RandomPollute(HashSet<MapUnity> set, int num) |
||||
|
{ |
||||
|
HashSet<MapUnity> randomNodes = MathTool.GetRandomElements(set, num); |
||||
|
foreach (var node in randomNodes) |
||||
|
{ |
||||
|
node.whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
} |
||||
|
GameManager.Instance.SyncColourCountUI(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
IEnumerator moveTowardsPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathTowardsPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveAwayFromPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathAwayFromPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private int getMoveStep() |
||||
|
{ |
||||
|
if (enemyNode.getStepRange() + 1 <= enemyNode.pasth.Count) |
||||
|
{ |
||||
|
return enemyNode.getStepRange() + 1; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
return enemyNode.pasth.Count; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveOneStep(MapUnity nexMapUnity) |
||||
|
{ |
||||
|
enemyNode.bleedCal(); |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
MapUnity disNode = nexMapUnity; |
||||
|
currentNode.blocked = false; |
||||
|
currentNode.enemyNode = null; |
||||
|
enemyNode.positionX = disNode.locationX; |
||||
|
enemyNode.positionY = disNode.locationY; |
||||
|
disNode.enemyNode = enemyNode; |
||||
|
yield return StartCoroutine(SkeletonArcherMoveCoroutine(disNode)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgNextActionCoroutine() |
||||
|
{ |
||||
|
if (enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.sleep)) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(JudgeActionCoroutine()); |
||||
|
} |
||||
|
//下回合意图
|
||||
|
ArcherAim(); |
||||
|
|
||||
|
//让下一个敌人运动
|
||||
|
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing; |
||||
|
} |
||||
|
IEnumerator SkeletonArcherMoveCoroutine(MapUnity endMapUnity)//移动到位置
|
||||
|
{ |
||||
|
while (true) |
||||
|
{ |
||||
|
float dDistance = Vector3.Distance(this.gameObject.transform.position, endMapUnity.transform.position); |
||||
|
|
||||
|
if (dDistance < 0.1f) |
||||
|
{ |
||||
|
break; |
||||
|
} |
||||
|
this.gameObject.transform.position = Vector3.Lerp(this.gameObject.transform.position, endMapUnity.transform.position, Time.deltaTime * moveSpeed); |
||||
|
|
||||
|
yield return 0; |
||||
|
} |
||||
|
|
||||
|
//判断腐蚀
|
||||
|
enemyNode.CorrodeRealize(endMapUnity); |
||||
|
yield break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
public void ArcherAim() |
||||
|
{ |
||||
|
Vector3 dir = GameManager.Instance.player.transform.position - this.transform.position; |
||||
|
Ray ray = new Ray(this.transform.position, dir); |
||||
|
if (Physics.Raycast(ray, out RaycastHit raycastHit, 500, layerMask.value)) |
||||
|
{ |
||||
|
enemyNode.lineAim.GetComponent<EnemyAimLine>().aimGamgObject = raycastHit.collider.gameObject; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void AttackDamage(int damage) |
||||
|
{ |
||||
|
Usermanager.Instance.SufferDamage(enemyNode.DamageCalculation(damage), enemyNode); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 7f71efaf8368f534ab344c5b2fd0e12d |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,286 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class HoodWanderer : MonoBehaviour |
||||
|
{ |
||||
|
EnemyNode enemyNode; |
||||
|
|
||||
|
[Header("瞄准射线图层剔除")] |
||||
|
public LayerMask layerMask; |
||||
|
|
||||
|
[Header("计数标量")] |
||||
|
public float time; |
||||
|
float lastTime = 0; |
||||
|
[Header("移动速度标量")] |
||||
|
public float moveSpeed; |
||||
|
//怪物行动
|
||||
|
public EnemyAction enemyAction; |
||||
|
|
||||
|
public Dictionary<EnemyAction, float> actionPool = new Dictionary<EnemyAction, float>() |
||||
|
{ |
||||
|
{ new EnemyActionAction_Shoot(), 0.3f }, |
||||
|
{ new EnemyAction_ShootAndPollute(), 0.4f }, |
||||
|
{ new EnemyActionAction_Shield(), 0.3f } |
||||
|
}; |
||||
|
|
||||
|
private void Start() |
||||
|
{ |
||||
|
enemyNode = GetComponent<EnemyNode>(); |
||||
|
} |
||||
|
|
||||
|
private void Update() |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void enemyTurn() |
||||
|
{ |
||||
|
StartCoroutine(JudgNextActionCoroutine()); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void ChooseAction() |
||||
|
{ |
||||
|
enemyAction = new EnemyActionAction_Shoot(); |
||||
|
enemyAction = enemyNode.GetRandomAction(actionPool); |
||||
|
Debug.Log("行动是:" + enemyAction); |
||||
|
enemyNode.enemyUIBar.SwitchIntention(enemyAction); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
|
||||
|
{ |
||||
|
Debug.Log("真正行动是:" + enemyAction); |
||||
|
switch (enemyAction) |
||||
|
{ |
||||
|
case EnemyActionAction_Shoot: |
||||
|
yield return StartCoroutine(RemoteAttackAction()); |
||||
|
break; |
||||
|
case EnemyAction_ShootAndPollute: |
||||
|
yield return StartCoroutine(shootAndPolluteAction()); |
||||
|
break; |
||||
|
case EnemyActionAction_Shield: |
||||
|
yield return StartCoroutine(shieldAction()); |
||||
|
break; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
IEnumerator shootAndPolluteAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
RandomPollute(getNodeTools.getAllPlayerNodes(), 3); |
||||
|
} |
||||
|
yield return new WaitForSeconds(1); |
||||
|
yield return StartCoroutine(moveAwayFromPlayer()); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
RandomPollute(getNodeTools.getAllPlayerNodes(), 3); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator shieldAction() |
||||
|
{ |
||||
|
enemyNode.sufferAbnormalCondition(AbnormalCondition.angerUpperDamage,3); |
||||
|
enemyNode.EnemyState.shieldValue += enemyNode.ShieldCalculation(5); |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveAwayFromPlayer()); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public void RandomPollute(HashSet<MapUnity> set, int num) |
||||
|
{ |
||||
|
HashSet<MapUnity> randomNodes = MathTool.GetRandomElements(set, num); |
||||
|
foreach (var node in randomNodes) |
||||
|
{ |
||||
|
node.whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
} |
||||
|
GameManager.Instance.SyncColourCountUI(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
IEnumerator moveTowardsPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathTowardsPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveAwayFromPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathAwayFromPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private int getMoveStep() |
||||
|
{ |
||||
|
if(enemyNode.getStepRange() + 1<= enemyNode.pasth.Count) |
||||
|
{ |
||||
|
return enemyNode.getStepRange() + 1; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
return enemyNode.pasth.Count; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveOneStep(MapUnity nexMapUnity) |
||||
|
{ |
||||
|
enemyNode.bleedCal(); |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
MapUnity disNode = nexMapUnity; |
||||
|
currentNode.blocked = false; |
||||
|
currentNode.enemyNode = null; |
||||
|
enemyNode.positionX = disNode.locationX; |
||||
|
enemyNode.positionY = disNode.locationY; |
||||
|
disNode.enemyNode = enemyNode; |
||||
|
yield return StartCoroutine(SkeletonArcherMoveCoroutine(disNode)); |
||||
|
} |
||||
|
|
||||
|
IEnumerator RemoteAttackAction() |
||||
|
{ |
||||
|
//Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.immunity, 1);
|
||||
|
//Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.banStep, 1);
|
||||
|
//enemyNode.sufferAbnormalCondition(AbnormalCondition.immunity, 1);
|
||||
|
enemyNode.sufferAbnormalCondition(AbnormalCondition.boom, 1); |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
|
||||
|
yield return new WaitForSeconds(1); |
||||
|
yield return StartCoroutine(moveAwayFromPlayer()); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgNextActionCoroutine() |
||||
|
{ |
||||
|
if (enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.sleep)) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(JudgeActionCoroutine()); |
||||
|
} |
||||
|
//下回合意图
|
||||
|
ArcherAim(); |
||||
|
|
||||
|
//让下一个敌人运动
|
||||
|
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing; |
||||
|
} |
||||
|
IEnumerator SkeletonArcherMoveCoroutine(MapUnity endMapUnity)//移动到位置
|
||||
|
{ |
||||
|
while (true) |
||||
|
{ |
||||
|
float dDistance = Vector3.Distance(this.gameObject.transform.position, endMapUnity.transform.position); |
||||
|
|
||||
|
if (dDistance < 0.1f) |
||||
|
{ |
||||
|
break; |
||||
|
} |
||||
|
this.gameObject.transform.position = Vector3.Lerp(this.gameObject.transform.position, endMapUnity.transform.position, Time.deltaTime * moveSpeed); |
||||
|
|
||||
|
yield return 0; |
||||
|
} |
||||
|
|
||||
|
//判断腐蚀
|
||||
|
enemyNode.CorrodeRealize(endMapUnity); |
||||
|
yield break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
public void ArcherColour(MapUnity currentNode) |
||||
|
{ |
||||
|
List<MapUnity> toColourPool = new List<MapUnity>(); |
||||
|
|
||||
|
if (currentNode.blocked == false) |
||||
|
toColourPool.Add(currentNode); |
||||
|
|
||||
|
for (int i = 0; i < currentNode.unitPool.Count; i++) |
||||
|
{ |
||||
|
if (currentNode.unitPool[i] != null && currentNode.unitPool[i].blocked == false) |
||||
|
{ |
||||
|
toColourPool.Add(currentNode.unitPool[i]); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
for (int c = 0; c < toColourPool.Count; c++) |
||||
|
{ |
||||
|
if (toColourPool.Count > 0) |
||||
|
{ |
||||
|
toColourPool[c].whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
if(toColourPool[c].playerOn) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public void ArcherAim() |
||||
|
{ |
||||
|
Vector3 dir = GameManager.Instance.player.transform.position - this.transform.position; |
||||
|
Ray ray = new Ray(this.transform.position, dir); |
||||
|
if (Physics.Raycast(ray, out RaycastHit raycastHit, 500, layerMask.value)) |
||||
|
{ |
||||
|
enemyNode.lineAim.GetComponent<EnemyAimLine>().aimGamgObject = raycastHit.collider.gameObject; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void AttackDamage() |
||||
|
{ |
||||
|
Usermanager.Instance.SufferDamage(enemyNode.DamageCalculation(enemyNode.EnemyState.damage),enemyNode); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,273 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class ParasiticMushroom : MonoBehaviour |
||||
|
{ |
||||
|
EnemyNode enemyNode; |
||||
|
|
||||
|
[Header("瞄准射线图层剔除")] |
||||
|
public LayerMask layerMask; |
||||
|
|
||||
|
[Header("计数标量")] |
||||
|
public float time; |
||||
|
float lastTime = 0; |
||||
|
[Header("移动速度标量")] |
||||
|
public float moveSpeed; |
||||
|
//怪物行动
|
||||
|
public EnemyAction enemyAction; |
||||
|
|
||||
|
public Dictionary<EnemyAction, float> actionPool = new Dictionary<EnemyAction, float>() |
||||
|
{ |
||||
|
{ new EnemyActionAction_Attack(), 0.4f }, |
||||
|
{ new EnemyAction_Parasitism(), 0.4f }, |
||||
|
{ new EnemyAction_AttackAndShield(), 0.2f } |
||||
|
}; |
||||
|
|
||||
|
private void Start() |
||||
|
{ |
||||
|
enemyNode = GetComponent<EnemyNode>(); |
||||
|
} |
||||
|
|
||||
|
private void Update() |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void enemyTurn() |
||||
|
{ |
||||
|
StartCoroutine(JudgNextActionCoroutine()); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void ChooseAction() |
||||
|
{ |
||||
|
enemyAction = new EnemyActionAction_Attack(); |
||||
|
enemyAction = enemyNode.GetRandomAction(actionPool); |
||||
|
Debug.Log("行动是:" + enemyAction); |
||||
|
enemyNode.enemyUIBar.SwitchIntention(enemyAction); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
|
||||
|
{ |
||||
|
Debug.Log("真正行动是:" + enemyAction); |
||||
|
switch (enemyAction) |
||||
|
{ |
||||
|
case EnemyActionAction_Attack: |
||||
|
yield return StartCoroutine(MeleeAttackAction()); |
||||
|
break; |
||||
|
case EnemyAction_Parasitism: |
||||
|
yield return StartCoroutine(MeleeAttackAndParasitism()); |
||||
|
break; |
||||
|
case EnemyAction_AttackAndShield: |
||||
|
yield return StartCoroutine(MeleeAttackAndShield()); |
||||
|
break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
IEnumerator MeleeAttackAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(enemyNode.EnemyState.damage); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(enemyNode.EnemyState.damage); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator MeleeAttackAndParasitism() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(enemyNode.EnemyState.damage); |
||||
|
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.parasitism, 1); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(enemyNode.EnemyState.damage); |
||||
|
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.parasitism, 1); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator MeleeAttackAndShield() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(8); |
||||
|
enemyNode.EnemyState.shieldValue += enemyNode.ShieldCalculation(7); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(8); |
||||
|
enemyNode.EnemyState.shieldValue += enemyNode.ShieldCalculation(7); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public void RandomPollute(HashSet<MapUnity> set, int num) |
||||
|
{ |
||||
|
HashSet<MapUnity> randomNodes = MathTool.GetRandomElements(set, num); |
||||
|
foreach (var node in randomNodes) |
||||
|
{ |
||||
|
node.whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
} |
||||
|
GameManager.Instance.SyncColourCountUI(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
IEnumerator moveTowardsPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathTowardsPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveAwayFromPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathAwayFromPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private int getMoveStep() |
||||
|
{ |
||||
|
if (enemyNode.getStepRange() + 1 <= enemyNode.pasth.Count) |
||||
|
{ |
||||
|
return enemyNode.getStepRange() + 1; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
return enemyNode.pasth.Count; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveOneStep(MapUnity nexMapUnity) |
||||
|
{ |
||||
|
enemyNode.bleedCal(); |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
MapUnity disNode = nexMapUnity; |
||||
|
currentNode.blocked = false; |
||||
|
currentNode.enemyNode = null; |
||||
|
enemyNode.positionX = disNode.locationX; |
||||
|
enemyNode.positionY = disNode.locationY; |
||||
|
disNode.enemyNode = enemyNode; |
||||
|
yield return StartCoroutine(SkeletonArcherMoveCoroutine(disNode)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgNextActionCoroutine() |
||||
|
{ |
||||
|
if (enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.sleep)) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(JudgeActionCoroutine()); |
||||
|
} |
||||
|
//下回合意图
|
||||
|
ArcherAim(); |
||||
|
|
||||
|
//让下一个敌人运动
|
||||
|
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing; |
||||
|
} |
||||
|
IEnumerator SkeletonArcherMoveCoroutine(MapUnity endMapUnity)//移动到位置
|
||||
|
{ |
||||
|
while (true) |
||||
|
{ |
||||
|
float dDistance = Vector3.Distance(this.gameObject.transform.position, endMapUnity.transform.position); |
||||
|
|
||||
|
if (dDistance < 0.1f) |
||||
|
{ |
||||
|
break; |
||||
|
} |
||||
|
this.gameObject.transform.position = Vector3.Lerp(this.gameObject.transform.position, endMapUnity.transform.position, Time.deltaTime * moveSpeed); |
||||
|
|
||||
|
yield return 0; |
||||
|
} |
||||
|
|
||||
|
//判断腐蚀
|
||||
|
enemyNode.CorrodeRealize(endMapUnity); |
||||
|
yield break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
public void ArcherAim() |
||||
|
{ |
||||
|
Vector3 dir = GameManager.Instance.player.transform.position - this.transform.position; |
||||
|
Ray ray = new Ray(this.transform.position, dir); |
||||
|
if (Physics.Raycast(ray, out RaycastHit raycastHit, 500, layerMask.value)) |
||||
|
{ |
||||
|
enemyNode.lineAim.GetComponent<EnemyAimLine>().aimGamgObject = raycastHit.collider.gameObject; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void AttackDamage(int damage) |
||||
|
{ |
||||
|
Usermanager.Instance.SufferDamage(enemyNode.DamageCalculation(damage), enemyNode); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: bda1c3f001b47d74f86c660612824f66 |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,273 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class ShatteringFistMushroom : MonoBehaviour |
||||
|
{ |
||||
|
EnemyNode enemyNode; |
||||
|
|
||||
|
[Header("瞄准射线图层剔除")] |
||||
|
public LayerMask layerMask; |
||||
|
|
||||
|
[Header("计数标量")] |
||||
|
public float time; |
||||
|
float lastTime = 0; |
||||
|
[Header("移动速度标量")] |
||||
|
public float moveSpeed; |
||||
|
//怪物行动
|
||||
|
public EnemyAction enemyAction; |
||||
|
|
||||
|
public Dictionary<EnemyAction, float> actionPool = new Dictionary<EnemyAction, float>() |
||||
|
{ |
||||
|
{ new EnemyActionAction_Attack(), 0.5f }, |
||||
|
{ new EnemyAction_BanStep(), 0.25f }, |
||||
|
{ new EnemyAction_Vulnerable(), 0.25f } |
||||
|
}; |
||||
|
|
||||
|
private void Start() |
||||
|
{ |
||||
|
enemyNode = GetComponent<EnemyNode>(); |
||||
|
} |
||||
|
|
||||
|
private void Update() |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void enemyTurn() |
||||
|
{ |
||||
|
StartCoroutine(JudgNextActionCoroutine()); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void ChooseAction() |
||||
|
{ |
||||
|
enemyAction = new EnemyActionAction_Attack(); |
||||
|
enemyAction = enemyNode.GetRandomAction(actionPool); |
||||
|
Debug.Log("行动是:" + enemyAction); |
||||
|
enemyNode.enemyUIBar.SwitchIntention(enemyAction); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
|
||||
|
{ |
||||
|
Debug.Log("真正行动是:" + enemyAction); |
||||
|
switch (enemyAction) |
||||
|
{ |
||||
|
case EnemyActionAction_Attack: |
||||
|
yield return StartCoroutine(MeleeAttackAction()); |
||||
|
break; |
||||
|
case EnemyAction_BanStep: |
||||
|
yield return StartCoroutine(MeleeAttackAndBanStepAction()); |
||||
|
break; |
||||
|
case EnemyAction_Vulnerable: |
||||
|
yield return StartCoroutine(MeleeAttackAndVulnerableAction()); |
||||
|
break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
IEnumerator MeleeAttackAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(enemyNode.EnemyState.damage); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(enemyNode.EnemyState.damage); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator MeleeAttackAndBanStepAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(enemyNode.EnemyState.damage); |
||||
|
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.banStep, 1); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(enemyNode.EnemyState.damage); |
||||
|
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.banStep, 1); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator MeleeAttackAndVulnerableAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(7); |
||||
|
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.vulnerable, 1); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
yield return new WaitForSeconds(1); |
||||
|
currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(7); |
||||
|
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.vulnerable, 1); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public void RandomPollute(HashSet<MapUnity> set, int num) |
||||
|
{ |
||||
|
HashSet<MapUnity> randomNodes = MathTool.GetRandomElements(set, num); |
||||
|
foreach (var node in randomNodes) |
||||
|
{ |
||||
|
node.whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
} |
||||
|
GameManager.Instance.SyncColourCountUI(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
IEnumerator moveTowardsPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathTowardsPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveAwayFromPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathAwayFromPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private int getMoveStep() |
||||
|
{ |
||||
|
if (enemyNode.getStepRange() + 1 <= enemyNode.pasth.Count) |
||||
|
{ |
||||
|
return enemyNode.getStepRange() + 1; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
return enemyNode.pasth.Count; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveOneStep(MapUnity nexMapUnity) |
||||
|
{ |
||||
|
enemyNode.bleedCal(); |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
MapUnity disNode = nexMapUnity; |
||||
|
currentNode.blocked = false; |
||||
|
currentNode.enemyNode = null; |
||||
|
enemyNode.positionX = disNode.locationX; |
||||
|
enemyNode.positionY = disNode.locationY; |
||||
|
disNode.enemyNode = enemyNode; |
||||
|
yield return StartCoroutine(SkeletonArcherMoveCoroutine(disNode)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgNextActionCoroutine() |
||||
|
{ |
||||
|
if (enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.sleep)) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(JudgeActionCoroutine()); |
||||
|
} |
||||
|
//下回合意图
|
||||
|
ArcherAim(); |
||||
|
|
||||
|
//让下一个敌人运动
|
||||
|
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing; |
||||
|
} |
||||
|
IEnumerator SkeletonArcherMoveCoroutine(MapUnity endMapUnity)//移动到位置
|
||||
|
{ |
||||
|
while (true) |
||||
|
{ |
||||
|
float dDistance = Vector3.Distance(this.gameObject.transform.position, endMapUnity.transform.position); |
||||
|
|
||||
|
if (dDistance < 0.1f) |
||||
|
{ |
||||
|
break; |
||||
|
} |
||||
|
this.gameObject.transform.position = Vector3.Lerp(this.gameObject.transform.position, endMapUnity.transform.position, Time.deltaTime * moveSpeed); |
||||
|
|
||||
|
yield return 0; |
||||
|
} |
||||
|
|
||||
|
//判断腐蚀
|
||||
|
enemyNode.CorrodeRealize(endMapUnity); |
||||
|
yield break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
public void ArcherAim() |
||||
|
{ |
||||
|
Vector3 dir = GameManager.Instance.player.transform.position - this.transform.position; |
||||
|
Ray ray = new Ray(this.transform.position, dir); |
||||
|
if (Physics.Raycast(ray, out RaycastHit raycastHit, 500, layerMask.value)) |
||||
|
{ |
||||
|
enemyNode.lineAim.GetComponent<EnemyAimLine>().aimGamgObject = raycastHit.collider.gameObject; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void AttackDamage(int damage) |
||||
|
{ |
||||
|
Usermanager.Instance.SufferDamage(enemyNode.DamageCalculation(damage), enemyNode); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: a9cfb911258ed7d4a80872da17003456 |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,267 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class SkullMage : MonoBehaviour |
||||
|
{ |
||||
|
EnemyNode enemyNode; |
||||
|
|
||||
|
[Header("瞄准射线图层剔除")] |
||||
|
public LayerMask layerMask; |
||||
|
|
||||
|
[Header("计数标量")] |
||||
|
public float time; |
||||
|
float lastTime = 0; |
||||
|
[Header("移动速度标量")] |
||||
|
public float moveSpeed; |
||||
|
//怪物行动
|
||||
|
public EnemyAction enemyAction; |
||||
|
|
||||
|
public Dictionary<EnemyAction, float> actionPool = new Dictionary<EnemyAction, float>() |
||||
|
{ |
||||
|
{ new EnemyActionAction_Shoot(), 0.2f }, |
||||
|
{ new EnemyAction_ShootAndPollute(), 0.8f }, |
||||
|
}; |
||||
|
|
||||
|
private void Start() |
||||
|
{ |
||||
|
enemyNode = GetComponent<EnemyNode>(); |
||||
|
} |
||||
|
|
||||
|
private void Update() |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void enemyTurn() |
||||
|
{ |
||||
|
StartCoroutine(JudgNextActionCoroutine()); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void ChooseAction() |
||||
|
{ |
||||
|
enemyAction = new EnemyActionAction_Shoot(); |
||||
|
enemyAction = enemyNode.GetRandomAction(actionPool); |
||||
|
Debug.Log("行动是:" + enemyAction); |
||||
|
enemyNode.enemyUIBar.SwitchIntention(enemyAction); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
|
||||
|
{ |
||||
|
Debug.Log("真正行动是:" + enemyAction); |
||||
|
switch (enemyAction) |
||||
|
{ |
||||
|
case EnemyActionAction_Shoot: |
||||
|
yield return StartCoroutine(RemoteAttackAction()); |
||||
|
break; |
||||
|
case EnemyAction_ShootAndPollute: |
||||
|
yield return StartCoroutine(shootAndPolluteAction()); |
||||
|
break; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
IEnumerator shootAndPolluteAction() |
||||
|
{ |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
RandomPollute(getNodeTools.getAllPlayerNodes(), 4); |
||||
|
} |
||||
|
yield return new WaitForSeconds(1); |
||||
|
yield return StartCoroutine(moveAwayFromPlayer()); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
RandomPollute(getNodeTools.getAllPlayerNodes(), 4); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public void RandomPollute(HashSet<MapUnity> set, int num) |
||||
|
{ |
||||
|
HashSet<MapUnity> randomNodes = MathTool.GetRandomElements(set, num); |
||||
|
foreach (var node in randomNodes) |
||||
|
{ |
||||
|
node.whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
} |
||||
|
GameManager.Instance.SyncColourCountUI(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
IEnumerator moveTowardsPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathTowardsPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveAwayFromPlayer() |
||||
|
{ |
||||
|
enemyNode.FindPathAwayFromPlayer(); |
||||
|
for (int i = 1; i < getMoveStep(); i++) |
||||
|
{ |
||||
|
if (enemyNode.pasth.Count > 1) |
||||
|
{ |
||||
|
yield return StartCoroutine(moveOneStep(enemyNode.pasth[i])); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private int getMoveStep() |
||||
|
{ |
||||
|
if (enemyNode.getStepRange() + 1 <= enemyNode.pasth.Count) |
||||
|
{ |
||||
|
return enemyNode.getStepRange() + 1; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
return enemyNode.pasth.Count; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
IEnumerator moveOneStep(MapUnity nexMapUnity) |
||||
|
{ |
||||
|
enemyNode.bleedCal(); |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
MapUnity disNode = nexMapUnity; |
||||
|
currentNode.blocked = false; |
||||
|
currentNode.enemyNode = null; |
||||
|
enemyNode.positionX = disNode.locationX; |
||||
|
enemyNode.positionY = disNode.locationY; |
||||
|
disNode.enemyNode = enemyNode; |
||||
|
yield return StartCoroutine(SkeletonArcherMoveCoroutine(disNode)); |
||||
|
} |
||||
|
|
||||
|
IEnumerator RemoteAttackAction() |
||||
|
{ |
||||
|
//Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.immunity, 1);
|
||||
|
//Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.banStep, 1);
|
||||
|
//enemyNode.sufferAbnormalCondition(AbnormalCondition.immunity, 1);
|
||||
|
enemyNode.sufferAbnormalCondition(AbnormalCondition.boom, 1); |
||||
|
MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; |
||||
|
if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) |
||||
|
{ |
||||
|
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
|
||||
|
yield return new WaitForSeconds(1); |
||||
|
yield return StartCoroutine(moveAwayFromPlayer()); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(moveTowardsPlayer()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
IEnumerator JudgNextActionCoroutine() |
||||
|
{ |
||||
|
if (enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.sleep)) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
yield return StartCoroutine(JudgeActionCoroutine()); |
||||
|
} |
||||
|
//下回合意图
|
||||
|
ArcherAim(); |
||||
|
|
||||
|
//让下一个敌人运动
|
||||
|
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing; |
||||
|
} |
||||
|
IEnumerator SkeletonArcherMoveCoroutine(MapUnity endMapUnity)//移动到位置
|
||||
|
{ |
||||
|
while (true) |
||||
|
{ |
||||
|
float dDistance = Vector3.Distance(this.gameObject.transform.position, endMapUnity.transform.position); |
||||
|
|
||||
|
if (dDistance < 0.1f) |
||||
|
{ |
||||
|
break; |
||||
|
} |
||||
|
this.gameObject.transform.position = Vector3.Lerp(this.gameObject.transform.position, endMapUnity.transform.position, Time.deltaTime * moveSpeed); |
||||
|
|
||||
|
yield return 0; |
||||
|
} |
||||
|
|
||||
|
//判断腐蚀
|
||||
|
enemyNode.CorrodeRealize(endMapUnity); |
||||
|
yield break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
public void ArcherColour(MapUnity currentNode) |
||||
|
{ |
||||
|
List<MapUnity> toColourPool = new List<MapUnity>(); |
||||
|
|
||||
|
if (currentNode.blocked == false) |
||||
|
toColourPool.Add(currentNode); |
||||
|
|
||||
|
for (int i = 0; i < currentNode.unitPool.Count; i++) |
||||
|
{ |
||||
|
if (currentNode.unitPool[i] != null && currentNode.unitPool[i].blocked == false) |
||||
|
{ |
||||
|
toColourPool.Add(currentNode.unitPool[i]); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
for (int c = 0; c < toColourPool.Count; c++) |
||||
|
{ |
||||
|
if (toColourPool.Count > 0) |
||||
|
{ |
||||
|
toColourPool[c].whoColour = MapUnity.WhoColour.enemyColour; |
||||
|
if (toColourPool[c].playerOn) |
||||
|
{ |
||||
|
AttackDamage(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public void ArcherAim() |
||||
|
{ |
||||
|
Vector3 dir = GameManager.Instance.player.transform.position - this.transform.position; |
||||
|
Ray ray = new Ray(this.transform.position, dir); |
||||
|
if (Physics.Raycast(ray, out RaycastHit raycastHit, 500, layerMask.value)) |
||||
|
{ |
||||
|
enemyNode.lineAim.GetComponent<EnemyAimLine>().aimGamgObject = raycastHit.collider.gameObject; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void AttackDamage() |
||||
|
{ |
||||
|
Usermanager.Instance.SufferDamage(enemyNode.DamageCalculation(enemyNode.EnemyState.damage), enemyNode); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 6c4186aa69e2c5b488336a9cb2d98064 |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: e038ef7935f7ddf4397b3ea4ec19e4f2 |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,18 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class EnemyAction_AttackAndShield : EnemyAction |
||||
|
{ |
||||
|
// Start is called before the first frame update
|
||||
|
void Start() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// Update is called once per frame
|
||||
|
void Update() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 12592c52a58d234499393729b0f2e197 |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,18 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class EnemyAction_BanStep : EnemyAction |
||||
|
{ |
||||
|
// Start is called before the first frame update
|
||||
|
void Start() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// Update is called once per frame
|
||||
|
void Update() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 480d13c96b7e04843ad2713607f8f23f |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,7 @@ |
|||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
public class EnemyAction_Nothing : EnemyAction |
||||
|
{ |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: 628a9c5762584cc47b6291c51b764d34 |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue