171 lines
6.3 KiB
Java
171 lines
6.3 KiB
Java
package p000;
|
|
|
|
import javax.microedition.m3g.Background;
|
|
|
|
/* renamed from: h */
|
|
/* loaded from: microcounterstrike.jar:h.class */
|
|
public class PlayerInputController extends InputStateBase {
|
|
|
|
/* renamed from: d */
|
|
private boolean flag193 = false;
|
|
|
|
/* renamed from: e */
|
|
private int value194 = 0;
|
|
|
|
/* renamed from: a */
|
|
public int value195 = 0;
|
|
|
|
/* renamed from: f */
|
|
private int value196 = 1;
|
|
|
|
/* renamed from: b */
|
|
public int value197 = 0;
|
|
|
|
/* renamed from: g */
|
|
private int value198 = 1;
|
|
|
|
public PlayerInputController() {
|
|
this.flag93 = new boolean[9];
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // p000.InputStateBase
|
|
/* renamed from: a */
|
|
public final void execute125() {
|
|
PlayerEntityBase abstractC0052u = PlayerManager.getInstance().localPlayer;
|
|
Combatant interfaceC0030bc = (Combatant) abstractC0052u;
|
|
if (this.flag93[5] || this.flag93[6] || this.flag93[7] || this.flag93[8]) {
|
|
abstractC0052u.value260++;
|
|
} else {
|
|
abstractC0052u.value260 = 0;
|
|
}
|
|
float f = PlayerEntityBase.value258 * abstractC0052u.value260;
|
|
float f2 = f >= PlayerEntityBase.value259 ? PlayerEntityBase.value259 : f;
|
|
if (this.flag93[1]) {
|
|
execute234((PlayerMovementEntity) abstractC0052u, 1);
|
|
} else if (this.flag93[2]) {
|
|
execute234((PlayerMovementEntity) abstractC0052u, 2);
|
|
}
|
|
if (this.flag93[3]) {
|
|
execute234((PlayerMovementEntity) abstractC0052u, 3);
|
|
} else if (this.flag93[4]) {
|
|
execute234((PlayerMovementEntity) abstractC0052u, 4);
|
|
}
|
|
if (this.flag93[1] || this.flag93[2] || this.flag93[3] || this.flag93[4]) {
|
|
if (this.value195 == 0) {
|
|
this.value196 = 1;
|
|
} else if (this.value195 == 3) {
|
|
this.value196 = -1;
|
|
}
|
|
this.value195 += this.value196;
|
|
} else if (this.value195 != 0) {
|
|
this.value195--;
|
|
}
|
|
interfaceC0030bc.getGrenadeController().execute74(MapManager.getInstance().world);
|
|
if (this.flag93[5]) {
|
|
abstractC0052u.getFloat248(f2);
|
|
} else if (this.flag93[6]) {
|
|
abstractC0052u.getFloat249(f2);
|
|
}
|
|
if (this.flag93[7]) {
|
|
float fMo250c = abstractC0052u.getFloat250(f2);
|
|
Background background = MapManager.getInstance().world.getBackground();
|
|
if (background != null) {
|
|
background.setCrop(background.getCropX() - ((int) (fMo250c * (background.getCropWidth() / 60.0f))), background.getCropY(), background.getCropWidth(), background.getCropHeight());
|
|
}
|
|
} else if (this.flag93[8]) {
|
|
float fMo251d = abstractC0052u.getFloat251(f2);
|
|
Background background2 = MapManager.getInstance().world.getBackground();
|
|
if (background2 != null) {
|
|
background2.setCrop(background2.getCropX() + ((int) (fMo251d * (background2.getCropWidth() / 60.0f))), background2.getCropY(), background2.getCropWidth(), background2.getCropHeight());
|
|
}
|
|
}
|
|
if (!this.flag93[0]) {
|
|
if (this.value197 != 0) {
|
|
this.value197--;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
int i = interfaceC0030bc.getLoadout().getActiveWeaponInfo().weaponCode;
|
|
int i2 = interfaceC0030bc.getLoadout().activeSlot;
|
|
if (i == 10 && !this.flag193) {
|
|
this.flag193 = true;
|
|
return;
|
|
}
|
|
if (i2 == 2 || i2 == 3 || i2 == 4 || i == 11) {
|
|
execute126(0, false);
|
|
}
|
|
if (i2 == 3) {
|
|
((HudRenderer) HudBase.getInstance()).execute311();
|
|
interfaceC0030bc.handleAction();
|
|
return;
|
|
}
|
|
if (interfaceC0030bc.getLoadout().getActiveAmmo() > 0) {
|
|
if (i == 10) {
|
|
float f3 = 0.1f * this.value194;
|
|
switch (RandomUtil.random237.nextInt(3)) {
|
|
case 0:
|
|
abstractC0052u.getFloat250(f3);
|
|
break;
|
|
case 1:
|
|
abstractC0052u.getFloat251(f3);
|
|
break;
|
|
}
|
|
this.value194++;
|
|
}
|
|
if (MainUiCanvasBase.getInstance().soundEnabled) {
|
|
if (i == 10) {
|
|
SoundManager.getInstance().execute199(1);
|
|
} else if (i == 11) {
|
|
SoundManager.getInstance().execute199(2);
|
|
} else if (i == 20) {
|
|
SoundManager.getInstance().execute199(3);
|
|
}
|
|
}
|
|
interfaceC0030bc.handleAction();
|
|
if (i2 == 1 || i2 == 2) {
|
|
((HudRenderer) HudBase.getInstance()).execute310();
|
|
if (interfaceC0030bc.getLoadout().getActiveAmmo() == 0) {
|
|
HudBase.getInstance().execute237(4, (String) null);
|
|
}
|
|
if (this.value197 == 0) {
|
|
this.value198 = 1;
|
|
} else if (this.value197 == 3) {
|
|
this.value198 = -1;
|
|
}
|
|
this.value197 += this.value198;
|
|
} else if (i2 == 4 && interfaceC0030bc.getLoadout().ammoBySlot[2] <= 0) {
|
|
interfaceC0030bc.getLoadout().clearSlot(4);
|
|
interfaceC0030bc.getLoadout().selectSlot(2);
|
|
}
|
|
if (i != 10 || this.flag193) {
|
|
return;
|
|
}
|
|
this.flag193 = false;
|
|
}
|
|
}
|
|
|
|
/* renamed from: a */
|
|
private static void execute234(PlayerMovementEntity c0054w, int i) {
|
|
float[] fArrM287a = c0054w.compute287(i, 1.0f);
|
|
if (c0054w.findHitTarget(c0054w.getSphereCollider283(fArrM287a)) == null) {
|
|
float[] fArrM299a = c0054w.getFloatArray299(fArrM287a);
|
|
if (fArrM299a[0] == 0.0f && fArrM299a[1] == 0.0f && fArrM299a[2] == 0.0f) {
|
|
return;
|
|
}
|
|
c0054w.execute300(fArrM299a);
|
|
}
|
|
}
|
|
|
|
@Override // p000.InputStateBase
|
|
/* renamed from: a */
|
|
public final void execute126(int i, boolean z) {
|
|
super.execute126(i, z);
|
|
if (i != -1 && i == 0 && z) {
|
|
this.flag193 = true;
|
|
this.value194 = 0;
|
|
}
|
|
}
|
|
}
|