Skip to content
Open
Show file tree
Hide file tree
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
12 changes: 0 additions & 12 deletions common/src/main/java/net/hydra/jojomod/client/KeyInputs.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ public static void showEXPKey(Player player, Minecraft client, boolean keyIsDown
}
public static void MoveKey4(Player player, Minecraft client, boolean keyIsDown, Options option){
if (!((StandUser) player).roundabout$isSealed() && !((StandUser)player).roundabout$isPossessed()) {
if (FateTypes.isHuman(player)) {
forceSummon(player, keyIsDown);
}
((StandUser) player).roundabout$getStandPowers().preButtonInput4(keyIsDown, option);
}
if (!FateTypes.isHuman(player)) {
Expand All @@ -98,9 +95,6 @@ public static void MoveKey4(Player player, Minecraft client, boolean keyIsDown,
}
public static void MoveKey3(Player player, Minecraft client, boolean keyIsDown, Options option){
if (!((StandUser) player).roundabout$isSealed() && !((StandUser)player).roundabout$isPossessed()) {
if (FateTypes.isHuman(player)) {
forceSummon(player, keyIsDown);
}
((StandUser) player).roundabout$getStandPowers().preButtonInput3(keyIsDown, option);
}
if (!FateTypes.isHuman(player)) {
Expand All @@ -109,9 +103,6 @@ public static void MoveKey3(Player player, Minecraft client, boolean keyIsDown,
}
public static void MoveKey2(Player player, Minecraft client, boolean keyIsDown, Options option){
if (!((StandUser) player).roundabout$isSealed() && !((StandUser)player).roundabout$isPossessed()) {
if (FateTypes.isHuman(player)) {
forceSummon(player, keyIsDown);
}
((StandUser) player).roundabout$getStandPowers().preButtonInput2(keyIsDown, option);
}
if (!FateTypes.isHuman(player)) {
Expand All @@ -120,9 +111,6 @@ public static void MoveKey2(Player player, Minecraft client, boolean keyIsDown,
}
public static void MoveKey1(Player player, Minecraft client, boolean keyIsDown, Options option){
if (!((StandUser) player).roundabout$isSealed() && !((StandUser)player).roundabout$isPossessed()) {
if (FateTypes.isHuman(player)) {
forceSummon(player, keyIsDown);
}
((StandUser) player).roundabout$getStandPowers().preButtonInput1(keyIsDown, option);
}
if (!FateTypes.isHuman(player)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.hydra.jojomod.event.ModParticles;
import net.hydra.jojomod.event.index.*;
import net.hydra.jojomod.fates.powers.AbilityScapeBasis;
import net.hydra.jojomod.stand.powers.elements.PowerContext;
import net.hydra.jojomod.stand.powers.presets.TWAndSPSharedPowers;
import net.hydra.jojomod.item.MaxStandDiscItem;
import net.hydra.jojomod.item.ModItems;
Expand Down Expand Up @@ -381,6 +382,12 @@ public void updateGuard(boolean yeet){
public void updateMove(float flot){
}

/** Stand abilities that the user can use without the stand actively being out (if the config is enabled). **/
public List<PowerContext> standlessAbilities(){
List<PowerContext> $$1 = Lists.newArrayList();
return $$1;
}

/**If you want something to happen when you spawn a projectile, this is your place.
* For instance, you could make every shot out arrow be super thrown, or create a penalty for throwing
* a knife*/
Expand Down Expand Up @@ -1818,39 +1825,39 @@ public boolean preCanInterruptPower(DamageSource sauce, Entity interrupter, bool

@Override
public void preButtonInput4(boolean keyIsDown, Options options){
if (hasStandActive(this.getSelf()) && !this.isClashing()) {
if (hasStandActive(this.getSelf()) || FateTypes.isHuman((this.getSelf())) && !this.isClashing()) {
if (!((TimeStop)this.getSelf().level()).CanTimeStopEntity(this.getSelf()) && !this.getStandUserSelf().roundabout$isPossessed() ) {
((StandUser) this.getSelf()).roundabout$setIdleTime(0);
buttonInput4(keyIsDown, options);
buttonInput4(keyIsDown, options, STAND);
}
}
}
@Override
public void preButtonInput3(boolean keyIsDown, Options options){
if (hasStandActive(this.getSelf()) && !this.isClashing()) {
if (hasStandActive(this.getSelf()) || FateTypes.isHuman((this.getSelf())) && !this.isClashing()) {
if (!((TimeStop)this.getSelf().level()).CanTimeStopEntity(this.getSelf()) && !this.getStandUserSelf().roundabout$isPossessed() ) {
((StandUser) this.getSelf()).roundabout$setIdleTime(0);
buttonInput3(keyIsDown, options);
buttonInput3(keyIsDown, options, STAND);
}
}
}

@Override
public void preButtonInput2(boolean keyIsDown, Options options){
if (hasStandActive(this.getSelf()) && !this.isClashing()) {
if (hasStandActive(this.getSelf()) || FateTypes.isHuman(this.getSelf()) && !this.isClashing()) {
if (!((TimeStop)this.getSelf().level()).CanTimeStopEntity(this.getSelf()) && !this.getStandUserSelf().roundabout$isPossessed() ) {
((StandUser) this.getSelf()).roundabout$setIdleTime(0);
buttonInput2(keyIsDown, options);
buttonInput2(keyIsDown, options, STAND);
}
}
}

@Override
public void preButtonInput1(boolean keyIsDown, Options options){
if (hasStandActive(this.getSelf()) && !this.isClashing()) {
if (hasStandActive(this.getSelf()) || FateTypes.isHuman(this.getSelf()) && !this.isClashing()) {
if (!((TimeStop)this.getSelf().level()).CanTimeStopEntity(this.getSelf()) && !this.getStandUserSelf().roundabout$isPossessed() ) {
((StandUser) this.getSelf()).roundabout$setIdleTime(0);
buttonInput1(keyIsDown, options);
buttonInput1(keyIsDown, options, STAND);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.hydra.jojomod.access.IPlayerEntity;
import net.hydra.jojomod.client.ClientNetworking;
import net.hydra.jojomod.client.KeyInputRegistry;
import net.hydra.jojomod.client.KeyInputs;
import net.hydra.jojomod.client.StandIcons;
import net.hydra.jojomod.entity.projectile.KnifeEntity;
import net.hydra.jojomod.entity.projectile.ThrownObjectEntity;
Expand All @@ -21,6 +22,7 @@
import net.hydra.jojomod.util.C2SPacketUtil;
import net.hydra.jojomod.util.MainUtil;
import net.hydra.jojomod.util.S2CPacketUtil;
import net.hydra.jojomod.util.config.ConfigManager;
import net.hydra.jojomod.util.gravity.GravityAPI;
import net.hydra.jojomod.util.gravity.RotationUtil;
import net.minecraft.ChatFormatting;
Expand Down Expand Up @@ -89,6 +91,12 @@ public AbilityScapeBasis(LivingEntity self) {
/**This is when the punch combo goes on cooldown. Default is 3 hit combo.*/
public final byte activePowerPhaseMax = 3;

/** Used to determine which ability set is being used. */
public final byte
FATE = 1,
STAND = 2;


/**This variable exists so that a client can begin displaying your attack hud info without ticking through it.
* Basically, stand attacks are clientside, but they need the server's confirmation to kickstart so you
* can't hit targets in frozen tps*/
Expand Down Expand Up @@ -1050,135 +1058,107 @@ public void powerActivate(PowerContext context) {
private boolean held3 = false;
private boolean held4 = false;

public void buttonInput1(boolean keyIsDown, Options options) {
public void buttonInput1(boolean keyIsDown, Options options, int source) {
if (keyIsDown)
{
if (held1)
return;
held1 = true;

if (!isHoldingSneak() && !isGuarding())
{
powerActivate(PowerContext.SKILL_1_NORMAL);
return;
}
if (isHoldingSneak() && !isGuarding())
{
powerActivate(PowerContext.SKILL_1_CROUCH);
return;
}
if (!isHoldingSneak() && isGuarding())
{
powerActivate(PowerContext.SKILL_1_GUARD);
return;
}
if (isHoldingSneak() && isGuarding())
{
powerActivate(PowerContext.SKILL_1_CROUCH_GUARD);
return;
}
PowerContext activatedPower;

if(isHoldingSneak())
if(isGuarding())
activatedPower = PowerContext.SKILL_1_CROUCH_GUARD;
else activatedPower = PowerContext.SKILL_1_CROUCH;
else if(isGuarding())
activatedPower = PowerContext.SKILL_1_GUARD;
else activatedPower = PowerContext.SKILL_1_NORMAL;

if ((!((StandUser) this.getSelf()).roundabout$getStandPowers().standlessAbilities().contains(activatedPower) || !ConfigManager.getConfig().miscellaneousSettings.standlessAbilities) && source == STAND)
KeyInputs.forceSummon(Minecraft.getInstance().player, keyIsDown);
powerActivate(activatedPower);
}
else
{
held1 = false;
}
}

public void buttonInput2(boolean keyIsDown, Options options) {
public void buttonInput2(boolean keyIsDown, Options options, int source) {
if (keyIsDown)
{
if (held2)
return;
held2 = true;

if (!isHoldingSneak() && !isGuarding())
{
powerActivate(PowerContext.SKILL_2_NORMAL);
return;
}
if (isHoldingSneak() && !isGuarding())
{
powerActivate(PowerContext.SKILL_2_CROUCH);
return;
}
if (!isHoldingSneak() && isGuarding())
{
powerActivate(PowerContext.SKILL_2_GUARD);
return;
}
if (isHoldingSneak() && isGuarding())
{
powerActivate(PowerContext.SKILL_2_CROUCH_GUARD);
return;
}
PowerContext activatedPower;

if(isHoldingSneak())
if(isGuarding())
activatedPower = PowerContext.SKILL_2_CROUCH_GUARD;
else activatedPower = PowerContext.SKILL_2_CROUCH;
else if(isGuarding())
activatedPower = PowerContext.SKILL_2_GUARD;
else activatedPower = PowerContext.SKILL_2_NORMAL;

if ((!((StandUser) this.getSelf()).roundabout$getStandPowers().standlessAbilities().contains(activatedPower) || !ConfigManager.getConfig().miscellaneousSettings.standlessAbilities) && source == STAND)
KeyInputs.forceSummon(Minecraft.getInstance().player, keyIsDown);
powerActivate(activatedPower);
}
else
{
held2 = false;
}
}

public void buttonInput3(boolean keyIsDown, Options options) {
public void buttonInput3(boolean keyIsDown, Options options, int source) {
if (keyIsDown)
{
if (held3)
return;
held3 = true;

if (!isHoldingSneak() && !isGuarding())
{
powerActivate(PowerContext.SKILL_3_NORMAL);
return;
}
if (isHoldingSneak() && !isGuarding())
{
powerActivate(PowerContext.SKILL_3_CROUCH);
return;
}
if (!isHoldingSneak() && isGuarding())
{
powerActivate(PowerContext.SKILL_3_GUARD);
return;
}
if (isHoldingSneak() && isGuarding())
{
powerActivate(PowerContext.SKILL_3_CROUCH_GUARD);
return;
}
PowerContext activatedPower;

if(isHoldingSneak())
if(isGuarding())
activatedPower = PowerContext.SKILL_3_CROUCH_GUARD;
else activatedPower = PowerContext.SKILL_3_CROUCH;
else if(isGuarding())
activatedPower = PowerContext.SKILL_3_GUARD;
else activatedPower = PowerContext.SKILL_3_NORMAL;

if ((!((StandUser) this.getSelf()).roundabout$getStandPowers().standlessAbilities().contains(activatedPower) || !ConfigManager.getConfig().miscellaneousSettings.standlessAbilities) && source == STAND)
KeyInputs.forceSummon(Minecraft.getInstance().player, keyIsDown);
powerActivate(activatedPower);
}
else
{
held3 = false;
}
}

public void buttonInput4(boolean keyIsDown, Options options) {
public void buttonInput4(boolean keyIsDown, Options options, int source) {
if (keyIsDown)
{
if (held4)
return;
held4 = true;

if (!isHoldingSneak() && !isGuarding())
{
powerActivate(PowerContext.SKILL_4_NORMAL);
return;
}
if (isHoldingSneak() && !isGuarding())
{
powerActivate(PowerContext.SKILL_4_CROUCH);
return;
}
if (!isHoldingSneak() && isGuarding())
{
powerActivate(PowerContext.SKILL_4_GUARD);
return;
}
if (isHoldingSneak() && isGuarding())
{
powerActivate(PowerContext.SKILL_4_CROUCH_GUARD);
return;
}
PowerContext activatedPower;

if(isHoldingSneak())
if(isGuarding())
activatedPower = PowerContext.SKILL_4_CROUCH_GUARD;
else activatedPower = PowerContext.SKILL_4_CROUCH;
else if(isGuarding())
activatedPower = PowerContext.SKILL_4_GUARD;
else activatedPower = PowerContext.SKILL_4_NORMAL;

if ((!((StandUser) this.getSelf()).roundabout$getStandPowers().standlessAbilities().contains(activatedPower) || !ConfigManager.getConfig().miscellaneousSettings.standlessAbilities) && source == STAND)
KeyInputs.forceSummon(Minecraft.getInstance().player, keyIsDown);
powerActivate(activatedPower);
}
else
{
Expand All @@ -1191,15 +1171,15 @@ public void preButtonInput4(boolean keyIsDown, Options options){
if (!hasStandActive(this.getSelf())) {
if (!((TimeStop)this.getSelf().level()).CanTimeStopEntity(this.getSelf()) && !this.getStandUserSelf().roundabout$isPossessed() ) {
((StandUser) this.getSelf()).roundabout$setIdleTime(0);
buttonInput4(keyIsDown, options);
buttonInput4(keyIsDown, options, FATE);
}
}
}
public void preButtonInput3(boolean keyIsDown, Options options){
if (!hasStandActive(this.getSelf())) {
if (!((TimeStop)this.getSelf().level()).CanTimeStopEntity(this.getSelf()) && !this.getStandUserSelf().roundabout$isPossessed() ) {
((StandUser) this.getSelf()).roundabout$setIdleTime(0);
buttonInput3(keyIsDown, options);
buttonInput3(keyIsDown, options, FATE);
}
}
}
Expand All @@ -1208,7 +1188,7 @@ public void preButtonInput2(boolean keyIsDown, Options options){
if (!hasStandActive(this.getSelf())) {
if (!((TimeStop)this.getSelf().level()).CanTimeStopEntity(this.getSelf()) && !this.getStandUserSelf().roundabout$isPossessed() ) {
((StandUser) this.getSelf()).roundabout$setIdleTime(0);
buttonInput2(keyIsDown, options);
buttonInput2(keyIsDown, options, FATE);
}
}
}
Expand All @@ -1217,7 +1197,7 @@ public void preButtonInput1(boolean keyIsDown, Options options){
if (!hasStandActive(this.getSelf())) {
if (!((TimeStop)this.getSelf().level()).CanTimeStopEntity(this.getSelf()) && !this.getStandUserSelf().roundabout$isPossessed() ) {
((StandUser) this.getSelf()).roundabout$setIdleTime(0);
buttonInput1(keyIsDown, options);
buttonInput1(keyIsDown, options, FATE);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public boolean tryBlockPosPower(int move, boolean forced, BlockPos blockPos){


@Override
public void buttonInput2(boolean KeyIsDown, Options options) {
public void buttonInput2(boolean KeyIsDown, Options options, int source) {

}
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,13 @@ public int getRangedBarrage2Length(){
return 60;
}

@Override
public List<PowerContext> standlessAbilities(){
List<PowerContext> $$1 = Lists.newArrayList();
$$1.add(PowerContext.SKILL_3_CROUCH);
return $$1;
}

@Override
public void renderAttackHud(GuiGraphics context, Player playerEntity,
int scaledWidth, int scaledHeight, int ticks, int vehicleHeartCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ public boolean clientForwardBarrage(){
public void preButtonInput4(boolean keyIsDown, Options options){
if (hasStandActive(this.getSelf()) && !this.isClashing()) {
((StandUser) this.getSelf()).roundabout$setIdleTime(0);
buttonInput4(keyIsDown, options);
buttonInput4(keyIsDown, options, STAND);
}
}

Expand Down
Loading