Merge pull request #5414 from kevlahnota/newmaster2

update crack overlay simple progression
This commit is contained in:
kevlahnota
2024-06-12 13:55:02 +08:00
committed by GitHub
3 changed files with 23 additions and 6 deletions

View File

@@ -326,8 +326,28 @@ public class CardView extends GameEntityView {
void updateDamage(Card c) {
set(TrackableProperty.Damage, c.getDamage());
updateLethalDamage(c);
//update CrackOverlay (currently 16 overlays)
set(TrackableProperty.CrackOverlay, c.getDamage() > 0 ? MyRandom.getRandom().nextInt(16) : 0);
//get crackoverlay by level of damage light 0, medium 1, heavy 2, max 3
int randCrackLevel = 0;
if (c.getDamage() > 0) {
switch (c.getDamage()) {
case 1:
case 2:
randCrackLevel = 0;
break;
case 3:
case 4:
randCrackLevel = 1;
break;
case 5:
case 6:
randCrackLevel = 2;
break;
default:
randCrackLevel = 3;
break;
}
}
set(TrackableProperty.CrackOverlay, randCrackLevel);
}
public int getAssignedDamage() {

View File

@@ -446,10 +446,7 @@ public class FSkin {
int crackCount = 0;
for (int j = 0; j < 4; j++) {
int x = j * 200;
for(int i = 0; i < 4; i++) {
int y = i * 279;
Forge.getAssets().cracks().put(crackCount++, new TextureRegion(Forge.getAssets().getTexture(f17), x, y, 200, 279));
}
Forge.getAssets().cracks().put(crackCount++, new TextureRegion(Forge.getAssets().getTexture(f17), x, 0, 200, 279));
}
//borders

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 KiB

After

Width:  |  Height:  |  Size: 115 KiB