Files
micro-counter-strike-decomp…/p000/RemotePlayer.java
2026-03-18 12:51:32 +03:00

164 lines
5.2 KiB
Java

package p000;
import javax.microedition.m3g.Camera;
import javax.microedition.m3g.RayIntersection;
import javax.microedition.m3g.World;
/* renamed from: be */
/* loaded from: microcounterstrike.jar:be.class */
public final class RemotePlayer extends NetworkPlayerEntity implements Combatant {
/* renamed from: r */
public int value147;
/* renamed from: s */
public int value148;
/* renamed from: t */
public WeaponLoadout weaponLoadout149;
/* renamed from: u */
public GrenadeController grenadeController150;
/* renamed from: x */
private AnimatedBillboardSprite animatedBillboardSprite151;
/* renamed from: v */
public boolean flag152;
/* renamed from: w */
public boolean flag153;
public RemotePlayer(int i, String str, int i2, int i3) {
super(i, str, i3);
this.flag152 = false;
this.flag153 = false;
this.value147 = i2;
}
@Override // p000.NetworkPlayerEntity, p000.PlayerEntityBase
/* renamed from: a */
public final void addToWorld(World world) {
super.addToWorld(world);
execute204(CameraManager.getInstance().getCamera121("MAIN"));
this.weaponLoadout149 = new WeaponLoadout();
if (this.grenadeController150 == null) {
this.grenadeController150 = new GrenadeController(this);
}
}
@Override // p000.NetworkPlayerEntity, p000.PlayerEntityBase
/* renamed from: a */
public final void removeFromWorld() {
super.removeFromWorld();
this.weaponLoadout149.dispose();
this.weaponLoadout149 = null;
this.grenadeController150.execute76();
this.grenadeController150 = null;
this.animatedBillboardSprite151 = null;
}
@Override // p000.NetworkPlayerEntity, p000.PlayerEntityBase
/* renamed from: b */
public final void respawn() {
super.respawn();
if (this.value148 <= 0) {
this.weaponLoadout149.resetToDefaultLoadout();
}
this.weaponLoadout149.addWeaponOrAmmo((WeaponInfo) WeaponLoadout.weaponCatalog.elementAt(WeaponLoadout.defaultPrimaryWeaponId));
this.weaponLoadout149.selectSlot(1);
this.value148 = 100;
}
@Override // p000.Combatant
/* renamed from: e */
public final int handleAction() {
this.animatedBillboardSprite151.execute183(true);
LocalPlayer c0008ah = (LocalPlayer) PlayerManager.getInstance().localPlayer;
if (RandomUtil.random237.nextInt(5) != 0) {
return 2;
}
c0008ah.onHit(this, this.weaponLoadout149.activeSlot, null, null);
this.flag153 = true;
return 1;
}
@Override // p000.Combatant
/* renamed from: a */
public final int onHit(PlayerEntityBase abstractC0052u, int i, RayIntersection rayIntersection, World world) {
if (this.value148 <= 0) {
return 0;
}
if (i != 4) {
ParticleEffectManager.getInstance().execute292(1, rayIntersection, world, CameraManager.getInstance().camera89);
}
int iM205a = getInt205(abstractC0052u, i);
int i2 = iM205a == 0 ? 1 : iM205a;
execute203(i2);
if (this.value148 <= 0) {
execute256(0);
((RoundBasedGameMode) GameSessionLoop.getInstance()).execute123(this);
}
return i2;
}
/* renamed from: b */
private void execute203(int i) {
this.value148 -= i;
if (this.value148 < 0) {
this.value148 = 0;
}
this.flag152 = true;
}
/* renamed from: a */
private void execute204(Camera camera) {
this.animatedBillboardSprite151 = MuzzleFlashManager.getInstance().getAnimatedBillboardSprite209(camera, 1);
((PlayerModel) this.playerModelBase261).group238.addChild(this.animatedBillboardSprite151.mesh121);
this.animatedBillboardSprite151.mesh121.translate(-0.03f, 2.0f, -0.2f);
}
/* renamed from: a */
private int getInt205(PlayerEntityBase abstractC0052u, int i) {
LocalPlayer c0008ah = (LocalPlayer) abstractC0052u;
int iNextInt = 0;
if (i == 1) {
iNextInt = c0008ah.loadout.getActiveWeaponInfo().weaponCode == 11 ? this.value148 : RandomUtil.random237.nextInt(c0008ah.loadout.getActiveWeaponInfo().damage);
} else if (i == 2 || i == 3) {
iNextInt = RandomUtil.random237.nextInt(c0008ah.loadout.getActiveWeaponInfo().damage);
} else if (i == 4) {
iNextInt = RandomUtil.random237.nextInt(6) * 20;
}
return iNextInt;
}
/* renamed from: a */
public final void execute206(boolean z) {
this.animatedBillboardSprite151.execute183(z);
}
@Override // p000.Combatant
/* renamed from: j */
public final int getHealth() {
return this.value148;
}
@Override // p000.Combatant
/* renamed from: m */
public final int getTeamId() {
return this.value147;
}
@Override // p000.Combatant
/* renamed from: k */
public final WeaponLoadout getLoadout() {
return this.weaponLoadout149;
}
@Override // p000.Combatant
/* renamed from: l */
public final GrenadeController getGrenadeController() {
return this.grenadeController150;
}
}