Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/java/io/blert/core/AttackDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public enum Category {
private final String name;

/**
* Item IDs that can perform this attack.
* Item IDs that can perform this attack. If empty, any weapon can perform it.
*/
private final int[] weaponIds;

Expand Down Expand Up @@ -158,6 +158,10 @@ public boolean is(int attackId) {
* Returns whether this attack can be performed with the given weapon.
*/
public boolean hasWeapon(int weaponId) {
if (weaponIds.length == 0) {
// Accepts any weapon.
return true;
}
for (int wid : weaponIds) {
if (wid == weaponId) {
return true;
Expand Down
Loading