dornan can now bitch slap you

This commit is contained in:
Boblet 2026-02-23 12:14:32 +01:00
parent e20d28f1d6
commit f4e43ce829
9 changed files with 140 additions and 2 deletions

View File

@ -34,6 +34,7 @@
* Due to repeated complaints, power armor sounds are now generally more quiet, with 25% volume for steps and 50% volume for jumping and landing
* Reduced mask man's projectile resistance from 75% to 50%
* Reduced maskman's resistance to damage above 50 from 75% to 50%
* Remnants power armor can now use the melee controller, allowing Sergeant Arch Dornan to beat the snot out of people
# Fixed
* Fixed proxy tiles that do not use electricity at all visually connecting to cables

View File

@ -11,11 +11,12 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
public class ArmorRPA extends ArmorFSBPowered implements IItemRendererProvider {
public class ArmorRPA extends ArmorFSBPowered implements IItemRendererProvider, IPAWeaponsProvider {
public ArmorRPA(ArmorMaterial material, int slot, String texture, long maxPower, long chargeRate, long consumption, long drain) {
super(material, slot, texture, maxPower, chargeRate, consumption, drain);
@ -52,4 +53,12 @@ public class ArmorRPA extends ArmorFSBPowered implements IItemRendererProvider {
"Head", "Body,Fan,Glow", "LeftArm", "RightArm", "LeftLeg", "RightLeg", "LeftBoot", "RightBoot");
}};
}
public static final ArmorRPAMelee meleeComponent = new ArmorRPAMelee();
@Override
public IPAMelee getMeleeComponent(EntityPlayer entity) {
if(this.hasFSBArmorIgnoreCharge(entity)) return meleeComponent;
return null;
}
}

View File

@ -0,0 +1,128 @@
package com.hbm.items.armor;
import org.lwjgl.opengl.GL11;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.factory.ConfettiUtil;
import com.hbm.items.weapon.sedna.factory.XFactoryPA;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations;
import com.hbm.render.anim.AnimationEnums.GunAnimation;
import com.hbm.render.anim.BusAnimationKeyframe.IType;
import com.hbm.util.EntityDamageUtil;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
public class ArmorRPAMelee implements IPAMelee {
@Override public void clickPrimary(ItemStack stack, LambdaContext ctx) { XFactoryPA.doSwing(stack, ctx, GunAnimation.CYCLE, 14); }
@Override public void clickSecondary(ItemStack stack, LambdaContext ctx) { XFactoryPA.doSwing(stack, ctx, GunAnimation.ALT_CYCLE, 20); }
@Override
public void orchestra(ItemStack stack, LambdaContext ctx) {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
boolean swings = type == GunAnimation.CYCLE && (timer == 3 || timer == 9);
boolean slap = type == GunAnimation.ALT_CYCLE && timer == 3;
if((swings || slap) && ctx.getPlayer() != null) {
MovingObjectPosition mop = EntityDamageUtil.getMouseOver(ctx.getPlayer(), 3.0D);
if(mop != null) {
if(mop.typeOfHit == mop.typeOfHit.ENTITY) {
float damage = swings ? 15F : 35F;
float knockback = swings ? 0F : 1.5F;
float dt = swings ? 5F : 15F;
float pierce = swings ? 0.1F : 0.25F;
if(mop.entityHit instanceof EntityLivingBase) {
EntityLivingBase living = (EntityLivingBase) mop.entityHit;
if(living.getMaxHealth() >= 100) damage *= 2.5;
EntityDamageUtil.attackEntityFromNT((EntityLivingBase) mop.entityHit, DamageSource.causePlayerDamage(ctx.getPlayer()), damage, true, false, knockback, dt, pierce);
if(living.getRNG().nextInt(slap ? 3 : 10) == 0 && !living.isEntityAlive()) ConfettiUtil.gib(living);
} else {
mop.entityHit.attackEntityFrom(DamageSource.causePlayerDamage(ctx.getPlayer()), damage);
}
entity.worldObj.playSoundAtEntity(mop.entityHit, "hbm:weapon.fire.smack", 1F, 0.9F + entity.getRNG().nextFloat() * 0.2F);
}
if(mop.typeOfHit == mop.typeOfHit.BLOCK) {
Block b = entity.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ);
entity.worldObj.playSoundEffect(mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, b.stepSound.getStepResourcePath(), 2F, 0.9F + entity.getRNG().nextFloat() * 0.2F);
}
}
}
}
@Override
public BusAnimation playAnim(ItemStack stack, GunAnimation type) {
if(type == GunAnimation.EQUIP) return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().setPos(-1, 0, 0).addPos(0, 0, 0, 250, IType.SIN_DOWN));
if(type == GunAnimation.CYCLE) return new BusAnimation()
.addBus("SWINGRIGHT", new BusAnimationSequence().addPos(1, 0, 0, 150, IType.SIN_DOWN).addPos(0, 0, 0, 250, IType.SIN_FULL))
.addBus("SWINGLEFT", new BusAnimationSequence().addPos(0, 0, 0, 300).addPos(1, 0, 0, 150, IType.SIN_DOWN).addPos(0, 0, 0, 250, IType.SIN_FULL));
if(type == GunAnimation.ALT_CYCLE) return new BusAnimation()
.addBus("SLAPTURN", new BusAnimationSequence().addPos(1, 0, 0, 250, IType.LINEAR).hold(150).addPos(0, 0, 0, 350, IType.LINEAR))
.addBus("SLAP", new BusAnimationSequence().hold(250).addPos(1, 0, 0, 150, IType.SIN_DOWN).addPos(0, 0, 0, 350, IType.SIN_FULL));
return null;
}
@Override public void setupFirstPerson(ItemStack stack) { }
@Override
public void renderFirstPerson(ItemStack stack) {
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.rpa_arm);
GL11.glTranslated(0, -1.5, 0.5);
double scale = 0.125D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double swingRight = HbmAnimations.getRelevantTransformation("SWINGRIGHT")[0];
double swingLeft = HbmAnimations.getRelevantTransformation("SWINGLEFT")[0];
double slapTurn = HbmAnimations.getRelevantTransformation("SLAPTURN")[0];
double slap = HbmAnimations.getRelevantTransformation("SLAP")[0];
double forwardTilt = 60 - 60 * equip[0];
double offsetOutward = 3;
double roll = 60;
GL11.glPushMatrix();
GL11.glTranslated(-12 * swingLeft + 2 * slapTurn - 5 * slap, 6 * slap, 5 * swingLeft + 8 * slap);
GL11.glRotated(forwardTilt - swingRight * 20, 1, 0, 0);
GL11.glTranslated(offsetOutward, 0, 0);
GL11.glTranslated(6, 8, 0);
GL11.glRotated(60 * swingLeft + 45 * slap, 0, 0, 1);
GL11.glRotated(roll + 15 * swingLeft + 45 * slapTurn, 0, 1, 0);
GL11.glTranslated(-6, -8, 0);
ResourceManager.armor_remnant.renderPart("LeftArm");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(12 * swingRight - 2 * slapTurn + 5 * slap, 6 * slap, 5 * swingRight + 8 * slap);
GL11.glRotated(forwardTilt - swingLeft * 20, 1, 0, 0);
GL11.glTranslated(-offsetOutward, 0, 0);
GL11.glTranslated(-6, 8, 0);
GL11.glRotated(-60 * swingRight - 45 * slap, 0, 0, 1);
GL11.glRotated(-roll - 15 * swingRight - 45 * slapTurn, 0, 1, 0);
GL11.glTranslated(6, -8, 0);
ResourceManager.armor_remnant.renderPart("RightArm");
GL11.glPopMatrix();
}
}

View File

@ -191,7 +191,7 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
BlockPos portPos = pos.offset(dir);
if(tanks[1].getFill() > 0) this.tryProvide(tanks[1], worldObj, portPos.getX(), portPos.getY(), portPos.getZ(), dir);
if(worldObj.getTotalWorldTime() % 20 == 0) this.trySubscribe(tanks[0].getTankType(), worldObj, portPos.getX(), portPos.getY(), portPos.getZ(), dir);
this.trySubscribe(tanks[0].getTankType(), worldObj, portPos.getX(), portPos.getY(), portPos.getZ(), dir);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 968 B

After

Width:  |  Height:  |  Size: 1.0 KiB