-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
256 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
core/src/com/isharryh/arkpets/behaviors/BehaviorEnemy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** Copyright (c) 2022-2023, Harry Huang | ||
* At GPL-3.0 License | ||
*/ | ||
package com.isharryh.arkpets.behaviors; | ||
|
||
import com.badlogic.gdx.utils.Array; | ||
import com.isharryh.arkpets.ArkConfig; | ||
import com.isharryh.arkpets.utils.AnimAutoData; | ||
import com.isharryh.arkpets.utils.AnimData; | ||
|
||
|
||
public class BehaviorEnemy extends Behavior { | ||
|
||
public BehaviorEnemy(ArkConfig $config) { | ||
super($config); | ||
action_list = new AnimAutoData[] { | ||
new AnimAutoData(new AnimData("Idle", true, true, 0, 0), | ||
4f, (int) (256 / Math.sqrt(config.behavior_ai_activation))), | ||
new AnimAutoData(new AnimData("Move_Loop", true, true, 0, 1), | ||
2f, 32*(config.behavior_allow_walk?1:0)), | ||
new AnimAutoData(new AnimData("Move_Loop", true, true, 0, -1), | ||
2f, 32*(config.behavior_allow_walk?1:0)) | ||
}; | ||
} | ||
|
||
public static boolean match(String[] animList) { | ||
Array<String> arr = new Array<>(animList); | ||
if (!arr.contains("Idle", false)) | ||
return false; | ||
if (!arr.contains("Move_Loop", false)) | ||
return false; | ||
if (!arr.contains("Attack", false)) | ||
return false; | ||
return true; | ||
} | ||
|
||
public AnimData defaultAnim() { | ||
return new AnimData("Idle", true, true); | ||
} | ||
|
||
public AnimData clickEnd() { | ||
return config.behavior_allow_interact?new AnimData("Attack", false, false, | ||
new AnimData("Idle", true, true)) : null; | ||
} | ||
|
||
public AnimData dragStart() { | ||
return action_list[0].ANIM; | ||
} | ||
|
||
public AnimData dragEnd() { | ||
return clickEnd(); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
core/src/com/isharryh/arkpets/behaviors/BehaviorEnemy2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** Copyright (c) 2022-2023, Harry Huang | ||
* At GPL-3.0 License | ||
*/ | ||
package com.isharryh.arkpets.behaviors; | ||
|
||
import com.badlogic.gdx.utils.Array; | ||
import com.isharryh.arkpets.ArkConfig; | ||
import com.isharryh.arkpets.utils.AnimAutoData; | ||
import com.isharryh.arkpets.utils.AnimData; | ||
|
||
|
||
public class BehaviorEnemy2 extends Behavior { | ||
|
||
public BehaviorEnemy2(ArkConfig $config) { | ||
super($config); | ||
action_list = new AnimAutoData[] { | ||
new AnimAutoData(new AnimData("Idle", true, true, 0, 0), | ||
4f, (int) (256 / Math.sqrt(config.behavior_ai_activation))), | ||
new AnimAutoData(new AnimData("Move", true, true, 0, 1), | ||
2f, 32*(config.behavior_allow_walk?1:0)), | ||
new AnimAutoData(new AnimData("Move", true, true, 0, -1), | ||
2f, 32*(config.behavior_allow_walk?1:0)) | ||
}; | ||
} | ||
|
||
public static boolean match(String[] animList) { | ||
Array<String> arr = new Array<>(animList); | ||
if (!arr.contains("Idle", false)) | ||
return false; | ||
if (!arr.contains("Move", false)) | ||
return false; | ||
if (!arr.contains("Attack", false)) | ||
return false; | ||
return true; | ||
} | ||
|
||
public AnimData defaultAnim() { | ||
return new AnimData("Idle", true, true); | ||
} | ||
|
||
public AnimData clickEnd() { | ||
return config.behavior_allow_interact?new AnimData("Attack", false, false, | ||
new AnimData("Idle", true, true)) : null; | ||
} | ||
|
||
public AnimData dragStart() { | ||
return action_list[0].ANIM; | ||
} | ||
|
||
public AnimData dragEnd() { | ||
return clickEnd(); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
core/src/com/isharryh/arkpets/behaviors/BehaviorEnemy3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** Copyright (c) 2022-2023, Harry Huang | ||
* At GPL-3.0 License | ||
*/ | ||
package com.isharryh.arkpets.behaviors; | ||
|
||
import com.badlogic.gdx.utils.Array; | ||
import com.isharryh.arkpets.ArkConfig; | ||
import com.isharryh.arkpets.utils.AnimAutoData; | ||
import com.isharryh.arkpets.utils.AnimData; | ||
|
||
|
||
public class BehaviorEnemy3 extends Behavior { | ||
|
||
public BehaviorEnemy3(ArkConfig $config) { | ||
super($config); | ||
action_list = new AnimAutoData[] { | ||
new AnimAutoData(new AnimData("Idle", true, true, 0, 0), | ||
4f, (int) (256 / Math.sqrt(config.behavior_ai_activation))) | ||
}; | ||
} | ||
|
||
public static boolean match(String[] animList) { | ||
Array<String> arr = new Array<>(animList); | ||
if (!arr.contains("Idle", false)) | ||
return false; | ||
if (!arr.contains("Attack", false)) | ||
return false; | ||
return true; | ||
} | ||
|
||
public AnimData defaultAnim() { | ||
return new AnimData("Idle", true, true); | ||
} | ||
|
||
public AnimData clickEnd() { | ||
return config.behavior_allow_interact?new AnimData("Attack", false, false, | ||
new AnimData("Idle", true, true)) : null; | ||
} | ||
|
||
public AnimData dragStart() { | ||
return action_list[0].ANIM; | ||
} | ||
|
||
public AnimData dragEnd() { | ||
return clickEnd(); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
core/src/com/isharryh/arkpets/behaviors/BehaviorEnemy4.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** Copyright (c) 2022-2023, Harry Huang | ||
* At GPL-3.0 License | ||
*/ | ||
package com.isharryh.arkpets.behaviors; | ||
|
||
import com.badlogic.gdx.utils.Array; | ||
import com.isharryh.arkpets.ArkConfig; | ||
import com.isharryh.arkpets.utils.AnimAutoData; | ||
import com.isharryh.arkpets.utils.AnimData; | ||
|
||
|
||
public class BehaviorEnemy4 extends Behavior { | ||
|
||
public BehaviorEnemy4(ArkConfig $config) { | ||
super($config); | ||
action_list = new AnimAutoData[] { | ||
new AnimAutoData(new AnimData("W_Idle", true, true, 0, 0), | ||
4f, (int) (256 / Math.sqrt(config.behavior_ai_activation))), | ||
new AnimAutoData(new AnimData("W_Move", true, true, 0, 1), | ||
2f, 32*(config.behavior_allow_walk?1:0)), | ||
new AnimAutoData(new AnimData("W_Move", true, true, 0, -1), | ||
2f, 32*(config.behavior_allow_walk?1:0)) | ||
}; | ||
} | ||
|
||
public static boolean match(String[] animList) { | ||
Array<String> arr = new Array<>(animList); | ||
if (!arr.contains("W_Idle", false)) | ||
return false; | ||
if (!arr.contains("W_Attack", false)) | ||
return false; | ||
return true; | ||
} | ||
|
||
public AnimData defaultAnim() { | ||
return new AnimData("W_Idle", true, true); | ||
} | ||
|
||
public AnimData clickEnd() { | ||
return config.behavior_allow_interact?new AnimData("W_Attack", false, false, | ||
new AnimData("W_Idle", true, true)) : null; | ||
} | ||
|
||
public AnimData dragStart() { | ||
return action_list[0].ANIM; | ||
} | ||
|
||
public AnimData dragEnd() { | ||
return clickEnd(); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
core/src/com/isharryh/arkpets/behaviors/BehaviorEnemy5.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** Copyright (c) 2022-2023, Harry Huang | ||
* At GPL-3.0 License | ||
*/ | ||
package com.isharryh.arkpets.behaviors; | ||
|
||
import com.badlogic.gdx.utils.Array; | ||
import com.isharryh.arkpets.ArkConfig; | ||
import com.isharryh.arkpets.utils.AnimAutoData; | ||
import com.isharryh.arkpets.utils.AnimData; | ||
|
||
|
||
public class BehaviorEnemy5 extends Behavior { | ||
|
||
public BehaviorEnemy5(ArkConfig $config) { | ||
super($config); | ||
action_list = new AnimAutoData[] { | ||
new AnimAutoData(new AnimData("Idle", true, true, 0, 0), | ||
4f, (int) (256 / Math.sqrt(config.behavior_ai_activation))), | ||
new AnimAutoData(new AnimData("Move", true, true, 0, 1), | ||
2f, 32*(config.behavior_allow_walk?1:0)), | ||
new AnimAutoData(new AnimData("Move", true, true, 0, -1), | ||
2f, 32*(config.behavior_allow_walk?1:0)) | ||
}; | ||
} | ||
|
||
public static boolean match(String[] animList) { | ||
Array<String> arr = new Array<>(animList); | ||
if (!arr.contains("Idle", false)) | ||
return false; | ||
if (!arr.contains("Move", false)) | ||
return false; | ||
return true; | ||
} | ||
|
||
public AnimData defaultAnim() { | ||
return new AnimData("Idle", true, true); | ||
} | ||
|
||
public AnimData dragStart() { | ||
return action_list[0].ANIM; | ||
} | ||
} |