Skip to content

Commit

Permalink
Update opcodes 67, 271 and 232
Browse files Browse the repository at this point in the history
  • Loading branch information
Argent77 committed Jan 7, 2025
1 parent f0f323b commit a2c877f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/org/infinity/resource/effects/BaseOpcode.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ public enum EffectEntry {
};

public static final String[] SUMMON_CONTROLS = {
"Match target", "Match target", "From CRE file", "Match target", "From CRE file", "Hostile", "From CRE file", "",
"From CRE file"
"Match target (position=effect)", "Match target (position=effect)", "From CRE file (position=effect)",
"Match target (position=target)", "From CRE file (position=target)", "Opposite of target (position=effect)"
};

public static final String[] REGEN_TYPES = {
Expand Down
9 changes: 9 additions & 0 deletions src/org/infinity/resource/effects/Opcode271.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.nio.ByteBuffer;
import java.util.List;

import org.infinity.datatype.Bitmap;
import org.infinity.datatype.Datatype;
import org.infinity.datatype.DecNumber;
import org.infinity.resource.AbstractStruct;
Expand Down Expand Up @@ -42,4 +43,12 @@ protected String makeEffectParamsGeneric(Datatype parent, ByteBuffer buffer, int
list.add(new DecNumber(buffer, offset + 4, 4, AbstractStruct.COMMON_UNUSED));
return null;
}

@Override
protected String makeEffectParamsEE(Datatype parent, ByteBuffer buffer, int offset, List<StructEntry> list,
boolean isVersion1) {
list.add(new DecNumber(buffer, offset, 4, AbstractStruct.COMMON_UNUSED));
list.add(new Bitmap(buffer, offset + 4, 4, EFFECT_MODE, new String[] { STRING_DEFAULT, "Disable AI" }));
return null;
}
}
14 changes: 13 additions & 1 deletion src/org/infinity/resource/effects/Opcode323.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package org.infinity.resource.effects;

import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.List;

import org.infinity.datatype.Bitmap;
Expand Down Expand Up @@ -35,7 +36,18 @@ public Opcode323() {
protected String makeEffectParamsEE(Datatype parent, ByteBuffer buffer, int offset, List<StructEntry> list,
boolean isVersion1) {
list.add(new DecNumber(buffer, offset, 4, EFFECT_VALUE));
list.add(new Bitmap(buffer, offset + 4, 4, EFFECT_MODIFIER_TYPE, INC_TYPES));
list.add(new Bitmap(buffer, offset + 4, 4, EFFECT_MODIFIER_TYPE, Arrays.copyOfRange(INC_TYPES, 0, 2)));
return null;
}

@Override
protected int makeEffectSpecial(Datatype parent, ByteBuffer buffer, int offset, List<StructEntry> list,
String resType, int param1, int param2) {
if (Profile.isEnhancedEdition()) {
list.add(new Bitmap(buffer, offset, 4, EFFECT_MODE, new String[] { STRING_DEFAULT, "Relative to target level" }));
return offset + 4;
} else {
return super.makeEffectSpecial(parent, buffer, offset, list, resType, param1, param2);
}
}
}

0 comments on commit a2c877f

Please sign in to comment.