mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
more IF ammo types, special attacks
This commit is contained in:
parent
dfa7b2eacd
commit
01de2ba803
@ -354,6 +354,7 @@ item.ammo_50bmg_du.name=.50 BMG Patrone (DU)
|
||||
item.ammo_50bmg_explosive.name=.50 BMG Patrone (Explosiv)
|
||||
item.ammo_50bmg_incendiary.name=.50 BMG Patrone (Brand)
|
||||
item.ammo_50bmg_phosphorus.name=.50 BMG Patrone (WP)
|
||||
item.ammo_50bmg_sleek.name=.50 BMG Patrone (IF-F&E)
|
||||
item.ammo_50bmg_star.name=.50 BMG Patrone (Sternenmetall)
|
||||
item.ammo_556.name=5.56mm Patrone
|
||||
item.ammo_556_ap.name=5.56mm Patrone (AP)
|
||||
@ -362,8 +363,10 @@ item.ammo_556_flechette.name=5.56mm Patrone (Flechet)
|
||||
item.ammo_556_flechette_du.name=5.56mm Flechetpatrone (Uran-Penetrator)
|
||||
item.ammo_556_flechette_incendiary.name=5.56mm Flechetpatrone (Brand)
|
||||
item.ammo_556_flechette_phosphorus.name=5.56mm Flechetpatrone (Phosphorspitze)
|
||||
item.ammo_556_flechette_sleek.name=5.56mm Flechetpatrone (IF-F&E)
|
||||
item.ammo_556_k.name=5.56mm K-Patrone
|
||||
item.ammo_556_phosphorus.name=5.56mm Patrone (WP)
|
||||
item.ammo_556_sleek.name=5.56mm Patrone (IF-F&E)
|
||||
item.ammo_556_star.name=5.56mm Patrone (Sternenmetall)
|
||||
item.ammo_556_tracer.name=5.56mm Patrone (Leuchtspur)
|
||||
item.ammo_5mm.name=5mm Patrone
|
||||
|
||||
@ -354,6 +354,7 @@ item.ammo_50bmg_du.name=.50 BMG Round (DU)
|
||||
item.ammo_50bmg_explosive.name=.50 BMG Round (Explosive)
|
||||
item.ammo_50bmg_incendiary.name=.50 BMG Round (Incendiary)
|
||||
item.ammo_50bmg_phosphorus.name=.50 BMG Round (WP)
|
||||
item.ammo_50bmg_sleek.name=.50 BMG Round (IF-R&D)
|
||||
item.ammo_50bmg_star.name=.50 BMG Round (Starmetal)
|
||||
item.ammo_556.name=5.56mm Round
|
||||
item.ammo_556_ap.name=5.56mm Round (AP)
|
||||
@ -362,8 +363,10 @@ item.ammo_556_flechette.name=5.56mm Flechette Round
|
||||
item.ammo_556_flechette_du.name=5.56mm Flechette Round (Uranium Penetrator)
|
||||
item.ammo_556_flechette_incendiary.name=5.56mm Flechette Round (Incendiary)
|
||||
item.ammo_556_flechette_phosphorus.name=5.56mm Flechette Round (Phosphorus-Tipped)
|
||||
item.ammo_556_flechette_sleek.name=5.56mm Flechette Round (IF-R&D)
|
||||
item.ammo_556_k.name=5.56mm K-Round
|
||||
item.ammo_556_phosphorus.name=5.56mm Round (WP)
|
||||
item.ammo_556_sleek.name=5.56mm Round (IF-R&D)
|
||||
item.ammo_556_star.name=5.56mm Round (Starmetal)
|
||||
item.ammo_556_tracer.name=5.56mm Round (Tracer)
|
||||
item.ammo_5mm.name=5mm Round
|
||||
|
||||
154
src/main/java/assets/hbm/models/weapons/meteor.obj
Normal file
154
src/main/java/assets/hbm/models/weapons/meteor.obj
Normal file
@ -0,0 +1,154 @@
|
||||
# Blender v2.79 (sub 0) OBJ File: 'meteor.blend'
|
||||
# www.blender.org
|
||||
o Cube
|
||||
v 0.500000 -0.171667 -0.171667
|
||||
v 0.171667 -0.500000 -0.171667
|
||||
v 0.171667 -0.171667 -0.500000
|
||||
v 0.500000 -0.171667 0.171667
|
||||
v 0.171667 -0.171667 0.500000
|
||||
v 0.171667 -0.500000 0.171667
|
||||
v -0.171667 -0.171667 0.500000
|
||||
v -0.500000 -0.171667 0.171667
|
||||
v -0.171667 -0.500000 0.171667
|
||||
v -0.171667 -0.171667 -0.500000
|
||||
v -0.171667 -0.500000 -0.171667
|
||||
v -0.500000 -0.171667 -0.171667
|
||||
v 0.171667 0.171667 -0.500000
|
||||
v 0.171667 0.500000 -0.171667
|
||||
v 0.500000 0.171667 -0.171667
|
||||
v 0.171667 0.171667 0.500000
|
||||
v 0.500000 0.171667 0.171668
|
||||
v 0.171667 0.500000 0.171667
|
||||
v -0.500000 0.171667 0.171667
|
||||
v -0.171667 0.171667 0.500000
|
||||
v -0.171667 0.500000 0.171667
|
||||
v -0.500000 0.171667 -0.171667
|
||||
v -0.171667 0.500000 -0.171667
|
||||
v -0.171667 0.171667 -0.500000
|
||||
vt 0.671633 0.328367
|
||||
vt 0.328367 0.671633
|
||||
vt 0.328367 0.328367
|
||||
vt 0.671633 0.671633
|
||||
vt 0.328367 0.328367
|
||||
vt 0.671633 0.328367
|
||||
vt 0.328367 0.328367
|
||||
vt 0.671633 0.671633
|
||||
vt 0.328367 0.671633
|
||||
vt 0.328367 0.671633
|
||||
vt 0.671633 0.328367
|
||||
vt 0.671633 0.671633
|
||||
vt 0.671633 0.671633
|
||||
vt 0.328367 0.328367
|
||||
vt 0.671633 0.328367
|
||||
vt 0.671633 0.328367
|
||||
vt 0.671633 0.000100
|
||||
vt 0.999900 0.328367
|
||||
vt 0.328367 0.328367
|
||||
vt 0.000100 0.328367
|
||||
vt 0.328367 0.000100
|
||||
vt 0.000100 0.328367
|
||||
vt 0.328367 0.000100
|
||||
vt 0.328367 0.999900
|
||||
vt 0.000100 0.671633
|
||||
vt 0.671633 0.000100
|
||||
vt 0.999900 0.328367
|
||||
vt 0.999900 0.671633
|
||||
vt 0.671633 0.999900
|
||||
vt 0.000100 0.328367
|
||||
vt 0.328367 0.000100
|
||||
vt 0.671633 0.328367
|
||||
vt 0.671633 0.000100
|
||||
vt 0.999900 0.328367
|
||||
vt 0.671633 0.000100
|
||||
vt 0.999900 0.671633
|
||||
vt 0.671633 0.671633
|
||||
vt 0.671633 0.000100
|
||||
vt 0.328367 0.671633
|
||||
vt 0.328367 0.999900
|
||||
vt 0.328367 0.671633
|
||||
vt 0.999900 0.671633
|
||||
vt 0.999900 0.671633
|
||||
vt 0.328367 0.328367
|
||||
vt 0.671633 0.000100
|
||||
vt 0.000100 0.328367
|
||||
vt 0.671633 0.671633
|
||||
vt 0.328367 0.671633
|
||||
vt 0.328367 0.000100
|
||||
vt 0.000100 0.671633
|
||||
vt 0.671633 0.999900
|
||||
vt 0.000100 0.671633
|
||||
vt 0.999900 0.328367
|
||||
vt 0.328367 0.000100
|
||||
vt 0.328367 0.000100
|
||||
vt 0.000100 0.671633
|
||||
vn 0.0000 0.0000 -1.0000
|
||||
vn 0.0000 -1.0000 0.0000
|
||||
vn -1.0000 0.0000 -0.0000
|
||||
vn 0.0000 1.0000 0.0000
|
||||
vn -0.0000 -0.0000 1.0000
|
||||
vn 0.5774 -0.5774 -0.5774
|
||||
vn 0.5774 -0.5774 0.5774
|
||||
vn -0.5774 -0.5774 0.5774
|
||||
vn -0.5774 -0.5774 -0.5774
|
||||
vn 0.5774 0.5774 -0.5774
|
||||
vn 0.5773 0.5774 0.5774
|
||||
vn -0.5774 0.5774 0.5774
|
||||
vn -0.5774 0.5774 -0.5774
|
||||
vn 0.7071 -0.7071 -0.0000
|
||||
vn 0.0000 -0.7071 -0.7071
|
||||
vn 0.7071 0.0000 -0.7071
|
||||
vn 0.0000 -0.7071 0.7071
|
||||
vn 0.7071 -0.0000 0.7071
|
||||
vn -0.7071 -0.7071 -0.0000
|
||||
vn -0.7071 -0.0000 0.7071
|
||||
vn -0.7071 0.0000 -0.7071
|
||||
vn 0.7071 0.7071 0.0000
|
||||
vn 0.0000 0.7071 -0.7071
|
||||
vn -0.0000 0.7071 0.7071
|
||||
vn -0.7071 0.7071 -0.0000
|
||||
vn 1.0000 -0.0000 0.0000
|
||||
s off
|
||||
f 13/1/1 10/2/1 24/3/1
|
||||
f 6/4/2 11/5/2 2/6/2
|
||||
f 19/7/3 12/8/3 8/9/3
|
||||
f 23/10/4 18/11/4 14/12/4
|
||||
f 16/13/5 7/14/5 5/15/5
|
||||
f 1/16/6 2/17/6 3/18/6
|
||||
f 4/19/7 5/20/7 6/21/7
|
||||
f 7/14/8 8/22/8 9/23/8
|
||||
f 10/2/9 11/24/9 12/25/9
|
||||
f 13/1/10 14/26/10 15/27/10
|
||||
f 16/13/11 17/28/11 18/29/11
|
||||
f 19/7/12 20/30/12 21/31/12
|
||||
f 22/32/13 23/33/13 24/34/13
|
||||
f 1/16/14 6/21/14 2/17/14
|
||||
f 11/5/15 3/35/15 2/6/15
|
||||
f 13/1/16 1/36/16 3/37/16
|
||||
f 5/15/17 9/23/17 6/38/17
|
||||
f 17/39/18 5/20/18 4/19/18
|
||||
f 12/8/19 9/40/19 8/9/19
|
||||
f 20/41/20 8/22/20 7/14/20
|
||||
f 22/32/21 10/42/21 12/8/21
|
||||
f 18/11/22 15/43/22 14/12/22
|
||||
f 24/3/23 14/26/23 13/1/23
|
||||
f 21/44/24 16/45/24 18/11/24
|
||||
f 23/10/25 19/46/25 21/44/25
|
||||
f 15/47/26 4/19/26 1/16/26
|
||||
f 13/1/1 3/37/1 10/2/1
|
||||
f 6/4/2 9/48/2 11/5/2
|
||||
f 19/7/3 22/32/3 12/8/3
|
||||
f 23/10/4 21/44/4 18/11/4
|
||||
f 16/13/5 20/41/5 7/14/5
|
||||
f 1/16/14 4/19/14 6/21/14
|
||||
f 11/5/15 10/49/15 3/35/15
|
||||
f 13/1/16 15/27/16 1/36/16
|
||||
f 5/15/17 7/14/17 9/23/17
|
||||
f 17/39/18 16/50/18 5/20/18
|
||||
f 12/8/19 11/51/19 9/40/19
|
||||
f 20/41/20 19/52/20 8/22/20
|
||||
f 22/32/21 24/34/21 10/42/21
|
||||
f 18/11/22 17/53/22 15/43/22
|
||||
f 24/3/23 23/54/23 14/26/23
|
||||
f 21/44/24 20/55/24 16/45/24
|
||||
f 23/10/25 22/56/25 19/46/25
|
||||
f 15/47/26 17/39/26 4/19/26
|
||||
BIN
src/main/java/assets/hbm/textures/items/ammo_50bmg_sleek.png
Normal file
BIN
src/main/java/assets/hbm/textures/items/ammo_50bmg_sleek.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 324 B |
Binary file not shown.
|
After Width: | Height: | Size: 284 B |
BIN
src/main/java/assets/hbm/textures/items/ammo_556_sleek.png
Normal file
BIN
src/main/java/assets/hbm/textures/items/ammo_556_sleek.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 286 B |
BIN
src/main/java/assets/hbm/textures/items/ingot_semtex.png
Normal file
BIN
src/main/java/assets/hbm/textures/items/ingot_semtex.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 279 B |
Binary file not shown.
|
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 327 B |
@ -1,10 +1,11 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import com.hbm.entity.mob.ai.EntityAIShootTarget;
|
||||
import com.hbm.entity.mob.ai.EntityAIMaskmanCasualApproach;
|
||||
import com.hbm.entity.mob.ai.EntityAIMaskmanLasergun;
|
||||
import com.hbm.entity.mob.ai.EntityAIMaskmanMinigun;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
import net.minecraft.entity.ai.EntityAIHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
@ -22,8 +23,9 @@ public class EntityMaskMan extends EntityMob implements IBossDisplayData {
|
||||
super(world);
|
||||
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false));
|
||||
this.tasks.addTask(2, new EntityAIShootTarget(this, true, true, 3));
|
||||
this.tasks.addTask(2, new EntityAIMaskmanCasualApproach(this, EntityPlayer.class, 1.0D, false));
|
||||
this.tasks.addTask(2, new EntityAIMaskmanMinigun(this, true, true, 3));
|
||||
this.tasks.addTask(3, new EntityAIMaskmanLasergun(this, true, true));
|
||||
this.tasks.addTask(3, new EntityAIWander(this, 1.0D));
|
||||
this.tasks.addTask(4, new EntityAILookIdle(this));
|
||||
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
@ -37,35 +39,12 @@ public class EntityMaskMan extends EntityMob implements IBossDisplayData {
|
||||
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(24.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(100.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(15.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(1000.0D);
|
||||
}
|
||||
|
||||
//public static final int dwTargetPlayer = 12;
|
||||
|
||||
/*protected void entityInit() {
|
||||
super.entityInit();
|
||||
this.getDataWatcher().addObject(dwTargetPlayer, new Integer(0));
|
||||
}*/
|
||||
|
||||
public void onLivingUpdate() {
|
||||
|
||||
super.onLivingUpdate();
|
||||
|
||||
/*if(worldObj.isRemote) {
|
||||
|
||||
} else {
|
||||
|
||||
if(this.getAITarget() != null) {
|
||||
this.getDataWatcher().updateObject(dwTargetPlayer, this.getAITarget().getEntityId());
|
||||
} else {
|
||||
this.getDataWatcher().updateObject(dwTargetPlayer, 0);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public boolean isAIEnabled() {
|
||||
return true;
|
||||
@ -77,6 +56,7 @@ public class EntityMaskMan extends EntityMob implements IBossDisplayData {
|
||||
|
||||
protected void dropFewItems(boolean bool, int i) {
|
||||
|
||||
this.dropItem(ModItems.coin_maskman, 1);
|
||||
if(!worldObj.isRemote)
|
||||
this.dropItem(ModItems.coin_maskman, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,165 @@
|
||||
package com.hbm.entity.mob.ai;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.pathfinding.PathPoint;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityAIMaskmanCasualApproach extends EntityAIBase {
|
||||
|
||||
World worldObj;
|
||||
EntityCreature attacker;
|
||||
int attackTick;
|
||||
double speedTowardsTarget;
|
||||
boolean longMemory;
|
||||
PathEntity entityPathEntity;
|
||||
Class classTarget;
|
||||
private int pathTimer;
|
||||
private double lastX;
|
||||
private double lastY;
|
||||
private double lastZ;
|
||||
|
||||
private int failedPathFindingPenalty;
|
||||
|
||||
public EntityAIMaskmanCasualApproach(EntityCreature owner, Class target, double speed, boolean longMemory) {
|
||||
this(owner, speed, longMemory);
|
||||
this.classTarget = target;
|
||||
}
|
||||
|
||||
public EntityAIMaskmanCasualApproach(EntityCreature owner, double speed, boolean longMemory) {
|
||||
this.attacker = owner;
|
||||
this.worldObj = owner.worldObj;
|
||||
this.speedTowardsTarget = speed;
|
||||
this.longMemory = longMemory;
|
||||
this.setMutexBits(3);
|
||||
}
|
||||
|
||||
public boolean shouldExecute() {
|
||||
EntityLivingBase entitylivingbase = this.attacker.getAttackTarget();
|
||||
|
||||
if(entitylivingbase == null) {
|
||||
return false;
|
||||
|
||||
} else if(!entitylivingbase.isEntityAlive()) {
|
||||
return false;
|
||||
|
||||
} else if(this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass())) {
|
||||
return false;
|
||||
|
||||
} else {
|
||||
|
||||
if(--this.pathTimer <= 0) {
|
||||
|
||||
double[] pos = getApproachPos();
|
||||
this.entityPathEntity = this.attacker.getNavigator().getPathToXYZ(pos[0], pos[1], pos[2]);
|
||||
this.pathTimer = 4 + this.attacker.getRNG().nextInt(7);
|
||||
return this.entityPathEntity != null;
|
||||
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean continueExecuting() {
|
||||
|
||||
EntityLivingBase entitylivingbase = this.attacker.getAttackTarget();
|
||||
|
||||
return entitylivingbase == null ? false
|
||||
: (!entitylivingbase.isEntityAlive() ? false
|
||||
: (!this.longMemory ? !this.attacker.getNavigator().noPath()
|
||||
: this.attacker.isWithinHomeDistance(MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posY), MathHelper.floor_double(entitylivingbase.posZ))));
|
||||
}
|
||||
|
||||
|
||||
public void startExecuting() {
|
||||
this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget);
|
||||
this.pathTimer = 0;
|
||||
}
|
||||
|
||||
|
||||
public void resetTask() {
|
||||
this.attacker.getNavigator().clearPathEntity();
|
||||
}
|
||||
|
||||
|
||||
public void updateTask() {
|
||||
|
||||
EntityLivingBase entitylivingbase = this.attacker.getAttackTarget();
|
||||
this.attacker.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F);
|
||||
double d0 = this.attacker.getDistanceSq(entitylivingbase.posX, entitylivingbase.boundingBox.minY, entitylivingbase.posZ);
|
||||
double d1 = (double) (this.attacker.width * 2.0F * this.attacker.width * 2.0F + entitylivingbase.width);
|
||||
|
||||
this.pathTimer--;
|
||||
|
||||
if((this.longMemory || this.attacker.getEntitySenses().canSee(entitylivingbase)) && this.pathTimer <= 0
|
||||
&& (this.lastX == 0.0D && this.lastY == 0.0D && this.lastZ == 0.0D
|
||||
|| entitylivingbase.getDistanceSq(this.lastX, this.lastY, this.lastZ) >= 1.0D
|
||||
|| this.attacker.getRNG().nextFloat() < 0.05F)) {
|
||||
|
||||
this.lastX = entitylivingbase.posX;
|
||||
this.lastY = entitylivingbase.boundingBox.minY;
|
||||
this.lastZ = entitylivingbase.posZ;
|
||||
this.pathTimer = failedPathFindingPenalty + 4 + this.attacker.getRNG().nextInt(7);
|
||||
|
||||
if(this.attacker.getNavigator().getPath() != null) {
|
||||
|
||||
PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint();
|
||||
if(finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) {
|
||||
failedPathFindingPenalty = 0;
|
||||
|
||||
} else {
|
||||
failedPathFindingPenalty += 10;
|
||||
}
|
||||
|
||||
} else {
|
||||
failedPathFindingPenalty += 10;
|
||||
}
|
||||
|
||||
if(d0 > 1024.0D) {
|
||||
this.pathTimer += 10;
|
||||
} else if(d0 > 256.0D) {
|
||||
this.pathTimer += 5;
|
||||
}
|
||||
|
||||
double[] pos = getApproachPos();
|
||||
if(!this.attacker.getNavigator().tryMoveToXYZ(pos[0], pos[1], pos[2], speedTowardsTarget)) {
|
||||
this.pathTimer += 15;
|
||||
}
|
||||
}
|
||||
|
||||
this.attackTick = Math.max(this.attackTick - 1, 0);
|
||||
|
||||
/*if(d0 <= d1 && this.attackTick <= 20) {
|
||||
this.attackTick = 20;
|
||||
|
||||
if(this.attacker.getHeldItem() != null) {
|
||||
this.attacker.swingItem();
|
||||
}
|
||||
|
||||
this.attacker.attackEntityAsMob(entitylivingbase);
|
||||
}*/
|
||||
}
|
||||
|
||||
public double[] getApproachPos() {
|
||||
|
||||
EntityLivingBase target = this.attacker.getAttackTarget();
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper(this.attacker.posX - target.posX, this.attacker.posY - target.posY, this.attacker.posZ - target.posZ);
|
||||
|
||||
double range = Math.min(vec.lengthVector(), 20) - 10;
|
||||
|
||||
vec = vec.normalize();
|
||||
|
||||
double x = this.attacker.posX + vec.xCoord * range + this.attacker.getRNG().nextGaussian() * 2;
|
||||
double y = this.attacker.posY + vec.yCoord - 5 + this.attacker.getRNG().nextInt(11);
|
||||
double z = this.attacker.posZ + vec.zCoord * range + this.attacker.getRNG().nextGaussian() * 2;
|
||||
|
||||
return new double[] {x, y, z};
|
||||
}
|
||||
}
|
||||
113
src/main/java/com/hbm/entity/mob/ai/EntityAIMaskmanLasergun.java
Normal file
113
src/main/java/com/hbm/entity/mob/ai/EntityAIMaskmanLasergun.java
Normal file
@ -0,0 +1,113 @@
|
||||
package com.hbm.entity.mob.ai;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBulletBase;
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class EntityAIMaskmanLasergun extends EntityAIBase {
|
||||
|
||||
private EntityCreature owner;
|
||||
private EntityLivingBase target;
|
||||
private EnumLaserAttack attack;
|
||||
private int timer;
|
||||
private int attackCount;
|
||||
|
||||
public EntityAIMaskmanLasergun(EntityCreature owner, boolean checkSight, boolean nearbyOnly) {
|
||||
this.owner = owner;
|
||||
|
||||
attack = EnumLaserAttack.values()[owner.getRNG().nextInt(3)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldExecute() {
|
||||
|
||||
EntityLivingBase entity = this.owner.getAttackTarget();
|
||||
|
||||
if(entity == null) {
|
||||
return false;
|
||||
|
||||
} else {
|
||||
this.target = entity;
|
||||
double dist = Vec3.createVectorHelper(target.posX - owner.posX, target.posY - owner.posY, target.posZ - owner.posZ).lengthVector();
|
||||
return dist > 10;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean continueExecuting() {
|
||||
return this.shouldExecute() || !this.owner.getNavigator().noPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTask() {
|
||||
|
||||
timer--;
|
||||
|
||||
if(timer <= 0) {
|
||||
timer = attack.delay;
|
||||
|
||||
switch(attack) {
|
||||
case ORB:
|
||||
EntityBulletBase orb = new EntityBulletBase(owner.worldObj, BulletConfigSyncingUtil.MASKMAN_ORB, owner, target, 2.0F, 0);
|
||||
orb.motionY += 0.5D;
|
||||
|
||||
owner.worldObj.spawnEntityInWorld(orb);
|
||||
owner.playSound("hbm:weapon.teslaShoot", 1.0F, 1.0F);
|
||||
break;
|
||||
|
||||
case MISSILE:
|
||||
EntityBulletBase missile = new EntityBulletBase(owner.worldObj, BulletConfigSyncingUtil.MASKMAN_ROCKET, owner, target, 1.0F, 0);
|
||||
Vec3 vec = Vec3.createVectorHelper(target.posX - owner.posX, 0, target.posZ - owner.posZ);
|
||||
missile.motionX = vec.xCoord * 0.05D;
|
||||
missile.motionY = 0.5D + owner.getRNG().nextDouble() * 0.5D;
|
||||
missile.motionZ = vec.zCoord * 0.05D;
|
||||
|
||||
owner.worldObj.spawnEntityInWorld(missile);
|
||||
owner.playSound("hbm:weapon.hkShoot", 1.0F, 1.0F);
|
||||
break;
|
||||
|
||||
case SPLASH:
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
EntityBulletBase tracer = new EntityBulletBase(owner.worldObj, BulletConfigSyncingUtil.MASKMAN_TRACER, owner, target, 1.0F, 0.05F);
|
||||
owner.worldObj.spawnEntityInWorld(tracer);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
attackCount++;
|
||||
|
||||
if(attackCount >= attack.amount) {
|
||||
|
||||
attackCount = 0;
|
||||
|
||||
int newAtk = attack.ordinal() + owner.getRNG().nextInt(EnumLaserAttack.values().length - 1);
|
||||
attack = EnumLaserAttack.values()[newAtk % EnumLaserAttack.values().length];
|
||||
}
|
||||
}
|
||||
|
||||
this.owner.rotationYaw = this.owner.rotationYawHead;
|
||||
}
|
||||
|
||||
private static enum EnumLaserAttack {
|
||||
|
||||
ORB(60, 5),
|
||||
MISSILE(10, 10),
|
||||
SPLASH(40, 3);
|
||||
|
||||
public int delay;
|
||||
public int amount;
|
||||
|
||||
private EnumLaserAttack(int delay, int amount) {
|
||||
this.delay = delay;
|
||||
this.amount = amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8,14 +8,14 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class EntityAIShootTarget extends EntityAIBase {
|
||||
public class EntityAIMaskmanMinigun extends EntityAIBase {
|
||||
|
||||
private EntityCreature owner;
|
||||
private EntityLivingBase target;
|
||||
int delay;
|
||||
int timer;
|
||||
|
||||
public EntityAIShootTarget(EntityCreature owner, boolean checkSight, boolean nearbyOnly, int delay) {
|
||||
public EntityAIMaskmanMinigun(EntityCreature owner, boolean checkSight, boolean nearbyOnly, int delay) {
|
||||
this.owner = owner;
|
||||
this.delay = delay;
|
||||
timer = delay;
|
||||
@ -49,7 +49,7 @@ public class EntityAIShootTarget extends EntityAIBase {
|
||||
if(timer <= 0) {
|
||||
timer = delay;
|
||||
|
||||
EntityBulletBase bullet = new EntityBulletBase(owner.worldObj, BulletConfigSyncingUtil.G20_SHRAPNEL, owner, target, 1.6F, 0);
|
||||
EntityBulletBase bullet = new EntityBulletBase(owner.worldObj, BulletConfigSyncingUtil.MASKMAN_BULLET, owner, target, 1.0F, 0);
|
||||
owner.worldObj.spawnEntityInWorld(bullet);
|
||||
owner.playSound("hbm:weapon.calShoot", 1.0F, 1.0F);
|
||||
}
|
||||
@ -59,6 +59,11 @@ public class EntityBulletBase extends Entity implements IProjectile {
|
||||
this.dataWatcher.updateObject(18, config);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
|
||||
if(this.config == null) {
|
||||
this.setDead();
|
||||
return;
|
||||
}
|
||||
|
||||
this.dataWatcher.updateObject(16, (byte)this.config.style);
|
||||
this.dataWatcher.updateObject(17, (byte)this.config.trail);
|
||||
|
||||
@ -184,6 +189,11 @@ public class EntityBulletBase extends Entity implements IProjectile {
|
||||
|
||||
if(config == null)
|
||||
config = BulletConfigSyncingUtil.pullConfig(dataWatcher.getWatchableObjectInt(18));
|
||||
|
||||
if(config == null){
|
||||
this.setDead();
|
||||
return;
|
||||
}
|
||||
|
||||
if(config.maxAge == 0) {
|
||||
this.setDead();
|
||||
|
||||
@ -93,6 +93,7 @@ public class BulletConfigSyncingUtil {
|
||||
public static int BMG50_DU = i++;
|
||||
public static int BMG50_STAR = i++;
|
||||
public static int BMG50_PHOSPHORUS = i++;
|
||||
public static int BMG50_SLEEK = i++;
|
||||
|
||||
public static int R5_NORMAL = i++;
|
||||
public static int R5_EXPLOSIVE = i++;
|
||||
@ -131,11 +132,13 @@ public class BulletConfigSyncingUtil {
|
||||
public static int R556_AP = i++;
|
||||
public static int R556_DU = i++;
|
||||
public static int R556_STAR = i++;
|
||||
public static int R556_SLEEK = i++;
|
||||
public static int R556_TRACER = i++;
|
||||
public static int R556_FLECHETTE = i++;
|
||||
public static int R556_FLECHETTE_INCENDIARY = i++;
|
||||
public static int R556_FLECHETTE_PHOSPHORUS = i++;
|
||||
public static int R556_FLECHETTE_DU = i++;
|
||||
public static int R556_FLECHETTE_SLEEK = i++;
|
||||
public static int R556_K = i++;
|
||||
|
||||
public static int G20_NORMAL_FIRE = i++;
|
||||
@ -163,6 +166,13 @@ public class BulletConfigSyncingUtil {
|
||||
public static int NUKE_MIRV = i++;
|
||||
public static int NUKE_AMAT = i++;
|
||||
public static int NUKE_PROTO = i++;
|
||||
|
||||
public static int MASKMAN_BULLET = i++;
|
||||
public static int MASKMAN_ORB = i++;
|
||||
public static int MASKMAN_BOLT = i++;
|
||||
public static int MASKMAN_ROCKET = i++;
|
||||
public static int MASKMAN_TRACER = i++;
|
||||
public static int MASKMAN_METEOR = i++;
|
||||
|
||||
public static void loadConfigsForSync() {
|
||||
|
||||
@ -248,6 +258,7 @@ public class BulletConfigSyncingUtil {
|
||||
configSet.put(BMG50_AP, Gun50BMGFactory.get50BMGAPConfig());
|
||||
configSet.put(BMG50_DU, Gun50BMGFactory.get50BMGDUConfig());
|
||||
configSet.put(BMG50_STAR, Gun50BMGFactory.get50BMGStarConfig());
|
||||
configSet.put(BMG50_SLEEK, Gun50BMGFactory.get50BMGSleekConfig());
|
||||
|
||||
configSet.put(R5_NORMAL, Gun5mmFactory.get5mmConfig());
|
||||
configSet.put(R5_EXPLOSIVE, Gun5mmFactory.get5mmExplosiveConfig());
|
||||
@ -286,11 +297,13 @@ public class BulletConfigSyncingUtil {
|
||||
configSet.put(R556_AP, Gun556mmFactory.get556APConfig());
|
||||
configSet.put(R556_DU, Gun556mmFactory.get556DUConfig());
|
||||
configSet.put(R556_STAR, Gun556mmFactory.get556StarConfig());
|
||||
configSet.put(R556_SLEEK, Gun556mmFactory.get556SleekConfig());
|
||||
configSet.put(R556_TRACER, Gun556mmFactory.get556TracerConfig());
|
||||
configSet.put(R556_FLECHETTE, Gun556mmFactory.get556FlechetteConfig());
|
||||
configSet.put(R556_FLECHETTE_INCENDIARY, Gun556mmFactory.get556FlechetteIncendiaryConfig());
|
||||
configSet.put(R556_FLECHETTE_PHOSPHORUS, Gun556mmFactory.get556FlechettePhosphorusConfig());
|
||||
configSet.put(R556_FLECHETTE_DU, Gun556mmFactory.get556FlechetteDUConfig());
|
||||
configSet.put(R556_FLECHETTE_SLEEK, Gun556mmFactory.get556FlechetteSleekConfig());
|
||||
configSet.put(R556_K, Gun556mmFactory.get556KConfig());
|
||||
|
||||
configSet.put(G20_NORMAL_FIRE, Gun20GaugeFactory.get20GaugeConfig().setToFire(3));
|
||||
@ -315,8 +328,16 @@ public class BulletConfigSyncingUtil {
|
||||
configSet.put(ROCKET_TOXIC_LASER, GunRocketFactory.getRocketChlorineConfig().setToGuided());
|
||||
|
||||
configSet.put(NUKE_NORMAL, GunFatmanFactory.getNukeConfig());
|
||||
configSet.put(NUKE_MIRV, GunFatmanFactory.getMirvConfig());
|
||||
configSet.put(NUKE_PROTO, GunFatmanFactory.getNukeProtoConfig());
|
||||
configSet.put(NUKE_AMAT, GunFatmanFactory.getBalefireConfig());
|
||||
|
||||
configSet.put(MASKMAN_BULLET, GunNPCFactory.getMaskmanBullet());
|
||||
configSet.put(MASKMAN_ORB, GunNPCFactory.getMaskmanOrb());
|
||||
configSet.put(MASKMAN_BOLT, GunNPCFactory.getMaskmanBolt());
|
||||
configSet.put(MASKMAN_ROCKET, GunNPCFactory.getMaskmanRocket());
|
||||
configSet.put(MASKMAN_TRACER, GunNPCFactory.getMaskmanTracer());
|
||||
configSet.put(MASKMAN_METEOR, GunNPCFactory.getMaskmanMeteor());
|
||||
}
|
||||
|
||||
public static BulletConfiguration pullConfig(int key) {
|
||||
|
||||
@ -99,6 +99,7 @@ public class BulletConfiguration {
|
||||
public static final int STYLE_GRENADE = 9;
|
||||
public static final int STYLE_BF = 10;
|
||||
public static final int STYLE_ORB = 11;
|
||||
public static final int STYLE_METEOR = 12;
|
||||
|
||||
public static final int PLINK_NONE = 0;
|
||||
public static final int PLINK_BULLET = 1;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.hbm.handler;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
@ -9,7 +8,6 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.gen.ChunkProviderServer;
|
||||
|
||||
public class RadiationWorldHandler {
|
||||
@ -22,7 +20,7 @@ public class RadiationWorldHandler {
|
||||
WorldServer serv = (WorldServer)world;
|
||||
|
||||
RadiationSavedData data = RadiationSavedData.getData(serv);
|
||||
List<Chunk> loadedChunks = ((ChunkProviderServer) serv.getChunkProvider()).func_152380_a();
|
||||
ChunkProviderServer provider = (ChunkProviderServer) serv.getChunkProvider();
|
||||
|
||||
int count = 50;//MainRegistry.worldRad;
|
||||
int threshold = 5;//MainRegistry.worldRadThreshold;
|
||||
@ -35,7 +33,6 @@ public class RadiationWorldHandler {
|
||||
Entry<ChunkCoordIntPair, Float> randEnt = (Entry<ChunkCoordIntPair, Float>) entries[world.rand.nextInt(entries.length)];
|
||||
|
||||
ChunkCoordIntPair coords = randEnt.getKey();
|
||||
Chunk chunk = world.getChunkFromChunkCoords(coords.chunkXPos, coords.chunkZPos);
|
||||
|
||||
for(int i = 0; i < 1; i++) {
|
||||
|
||||
@ -43,7 +40,7 @@ public class RadiationWorldHandler {
|
||||
if(randEnt == null || randEnt.getValue() < threshold)
|
||||
continue;
|
||||
|
||||
if(chunk != null && loadedChunks.contains(chunk)) {
|
||||
if(provider.chunkExists(coords.chunkXPos, coords.chunkZPos)) {
|
||||
|
||||
for(int a = 0; a < 16; a ++) {
|
||||
for(int b = 0; b < 16; b ++) {
|
||||
|
||||
@ -6,6 +6,7 @@ import com.hbm.entity.projectile.EntityBulletBase;
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.interfaces.IBulletHitBehavior;
|
||||
import com.hbm.interfaces.IBulletImpactBehavior;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
@ -14,6 +15,7 @@ import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
@ -49,6 +51,7 @@ public class Gun50BMGFactory {
|
||||
config.config.add(BulletConfigSyncingUtil.BMG50_AP);
|
||||
config.config.add(BulletConfigSyncingUtil.BMG50_DU);
|
||||
config.config.add(BulletConfigSyncingUtil.BMG50_STAR);
|
||||
config.config.add(BulletConfigSyncingUtil.BMG50_SLEEK);
|
||||
|
||||
return config;
|
||||
}
|
||||
@ -82,6 +85,7 @@ public class Gun50BMGFactory {
|
||||
config.config.add(BulletConfigSyncingUtil.BMG50_AP);
|
||||
config.config.add(BulletConfigSyncingUtil.BMG50_DU);
|
||||
config.config.add(BulletConfigSyncingUtil.BMG50_STAR);
|
||||
config.config.add(BulletConfigSyncingUtil.BMG50_SLEEK);
|
||||
|
||||
return config;
|
||||
}
|
||||
@ -204,4 +208,54 @@ public class Gun50BMGFactory {
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public static BulletConfiguration get50BMGSleekConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_50bmg_sleek;
|
||||
bullet.spread *= inaccuracy;
|
||||
bullet.dmgMin = 50;
|
||||
bullet.dmgMax = 70;
|
||||
bullet.wear = 10;
|
||||
bullet.leadChance = 100;
|
||||
bullet.doesPenetrate = false;
|
||||
|
||||
bullet.bHit = new IBulletHitBehavior() {
|
||||
|
||||
@Override
|
||||
public void behaveEntityHit(EntityBulletBase bullet, Entity hit) {
|
||||
|
||||
if(bullet.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR);
|
||||
meteor.setPosition(hit.posX, hit.posY + 30 + meteor.worldObj.rand.nextInt(10), hit.posZ);
|
||||
meteor.motionY = -1D;
|
||||
meteor.shooter = bullet.shooter;
|
||||
bullet.worldObj.spawnEntityInWorld(meteor);
|
||||
}
|
||||
};
|
||||
|
||||
bullet.bImpact = new IBulletImpactBehavior() {
|
||||
|
||||
@Override
|
||||
public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) {
|
||||
|
||||
if(bullet.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
if(y == -1)
|
||||
return;
|
||||
|
||||
EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR);
|
||||
meteor.setPosition(bullet.posX, bullet.posY + 30 + meteor.worldObj.rand.nextInt(10), bullet.posZ);
|
||||
meteor.motionY = -1D;
|
||||
meteor.shooter = bullet.shooter;
|
||||
bullet.worldObj.spawnEntityInWorld(meteor);
|
||||
}
|
||||
};
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.hbm.entity.projectile.EntityBulletBase;
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.interfaces.IBulletHitBehavior;
|
||||
import com.hbm.interfaces.IBulletImpactBehavior;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
@ -18,6 +19,7 @@ import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
@ -56,6 +58,7 @@ public class Gun556mmFactory {
|
||||
config.config.add(BulletConfigSyncingUtil.R556_AP);
|
||||
config.config.add(BulletConfigSyncingUtil.R556_DU);
|
||||
config.config.add(BulletConfigSyncingUtil.R556_STAR);
|
||||
config.config.add(BulletConfigSyncingUtil.R556_SLEEK);
|
||||
config.config.add(BulletConfigSyncingUtil.R556_K);
|
||||
|
||||
return config;
|
||||
@ -100,6 +103,7 @@ public class Gun556mmFactory {
|
||||
config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE_INCENDIARY);
|
||||
config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE_PHOSPHORUS);
|
||||
config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE_DU);
|
||||
config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE_SLEEK);
|
||||
config.config.add(BulletConfigSyncingUtil.R556_K);
|
||||
|
||||
return config;
|
||||
@ -234,6 +238,55 @@ public class Gun556mmFactory {
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public static BulletConfiguration get556SleekConfig() {
|
||||
|
||||
BulletConfiguration bullet = get556Config();
|
||||
|
||||
bullet.ammo = ModItems.ammo_556_sleek;
|
||||
bullet.dmgMin = 15;
|
||||
bullet.dmgMax = 20;
|
||||
bullet.wear = 10;
|
||||
bullet.leadChance = 100;
|
||||
bullet.doesPenetrate = false;
|
||||
|
||||
bullet.bHit = new IBulletHitBehavior() {
|
||||
|
||||
@Override
|
||||
public void behaveEntityHit(EntityBulletBase bullet, Entity hit) {
|
||||
|
||||
if(bullet.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR);
|
||||
meteor.setPosition(hit.posX, hit.posY + 30 + meteor.worldObj.rand.nextInt(10), hit.posZ);
|
||||
meteor.motionY = -1D;
|
||||
meteor.shooter = bullet.shooter;
|
||||
bullet.worldObj.spawnEntityInWorld(meteor);
|
||||
}
|
||||
};
|
||||
|
||||
bullet.bImpact = new IBulletImpactBehavior() {
|
||||
|
||||
@Override
|
||||
public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) {
|
||||
|
||||
if(bullet.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
if(y == -1)
|
||||
return;
|
||||
|
||||
EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR);
|
||||
meteor.setPosition(bullet.posX, bullet.posY + 30 + meteor.worldObj.rand.nextInt(10), bullet.posZ);
|
||||
meteor.motionY = -1D;
|
||||
meteor.shooter = bullet.shooter;
|
||||
bullet.worldObj.spawnEntityInWorld(meteor);
|
||||
}
|
||||
};
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public static BulletConfiguration get556TracerConfig() {
|
||||
|
||||
BulletConfiguration bullet = get556Config();
|
||||
@ -313,6 +366,55 @@ public class Gun556mmFactory {
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public static BulletConfiguration get556FlechetteSleekConfig() {
|
||||
|
||||
BulletConfiguration bullet = get556FlechetteConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_556_flechette_sleek;
|
||||
bullet.dmgMin = 12;
|
||||
bullet.dmgMax = 16;
|
||||
bullet.wear = 10;
|
||||
bullet.leadChance = 50;
|
||||
bullet.doesPenetrate = false;
|
||||
|
||||
bullet.bHit = new IBulletHitBehavior() {
|
||||
|
||||
@Override
|
||||
public void behaveEntityHit(EntityBulletBase bullet, Entity hit) {
|
||||
|
||||
if(bullet.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR);
|
||||
meteor.setPosition(hit.posX, hit.posY + 30 + meteor.worldObj.rand.nextInt(10), hit.posZ);
|
||||
meteor.motionY = -1D;
|
||||
meteor.shooter = bullet.shooter;
|
||||
bullet.worldObj.spawnEntityInWorld(meteor);
|
||||
}
|
||||
};
|
||||
|
||||
bullet.bImpact = new IBulletImpactBehavior() {
|
||||
|
||||
@Override
|
||||
public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) {
|
||||
|
||||
if(bullet.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
if(y == -1)
|
||||
return;
|
||||
|
||||
EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR);
|
||||
meteor.setPosition(bullet.posX, bullet.posY + 30 + meteor.worldObj.rand.nextInt(10), bullet.posZ);
|
||||
meteor.motionY = -1D;
|
||||
meteor.shooter = bullet.shooter;
|
||||
bullet.worldObj.spawnEntityInWorld(meteor);
|
||||
}
|
||||
};
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public static BulletConfiguration get556KConfig() {
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.interfaces.IBulletImpactBehavior;
|
||||
import com.hbm.interfaces.IBulletUpdateBehavior;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
@ -43,6 +44,20 @@ public class GunFatmanFactory {
|
||||
return config;
|
||||
}
|
||||
|
||||
public static GunConfiguration getMIRVConfig() {
|
||||
|
||||
GunConfiguration config = getFatmanConfig();
|
||||
|
||||
config.name = "M-42 Experimental MIRV";
|
||||
config.manufacturer = "Fort Strong";
|
||||
|
||||
config.config = new ArrayList<Integer>();
|
||||
config.config.add(BulletConfigSyncingUtil.NUKE_MIRV);
|
||||
config.durability = 1000;
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
public static GunConfiguration getBELConfig() {
|
||||
|
||||
GunConfiguration config = getFatmanConfig();
|
||||
@ -108,6 +123,34 @@ public class GunFatmanFactory {
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
|
||||
|
||||
bullet.ammo = ModItems.gun_mirv_ammo;
|
||||
bullet.style = BulletConfiguration.STYLE_MIRV;
|
||||
bullet.velocity *= 3;
|
||||
|
||||
bullet.bUpdate = new IBulletUpdateBehavior() {
|
||||
|
||||
@Override
|
||||
public void behaveUpdate(EntityBulletBase bullet) {
|
||||
|
||||
if(bullet.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
if(bullet.ticksExisted == 15) {
|
||||
bullet.setDead();
|
||||
|
||||
for(int i = 0; i < 6; i++) {
|
||||
|
||||
EntityBulletBase nuke = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.NUKE_NORMAL);
|
||||
nuke.setPosition(bullet.posX, bullet.posY, bullet.posZ);
|
||||
double mod = 0.1D;
|
||||
nuke.motionX = bullet.worldObj.rand.nextGaussian() * mod;
|
||||
nuke.motionY = -0.1D;
|
||||
nuke.motionZ = bullet.worldObj.rand.nextGaussian() * mod;
|
||||
bullet.worldObj.spawnEntityInWorld(nuke);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -148,8 +148,8 @@ public class GunGrenadeFactory {
|
||||
|
||||
bullet.ammo = ModItems.ammo_grenade_concussion;
|
||||
bullet.velocity = 2.0F;
|
||||
bullet.dmgMin = 20;
|
||||
bullet.dmgMax = 15;
|
||||
bullet.dmgMin = 15;
|
||||
bullet.dmgMax = 20;
|
||||
bullet.blockDamage = false;
|
||||
bullet.explosive = 10.0F;
|
||||
bullet.trail = 3;
|
||||
|
||||
194
src/main/java/com/hbm/handler/guncfg/GunNPCFactory.java
Normal file
194
src/main/java/com/hbm/handler/guncfg/GunNPCFactory.java
Normal file
@ -0,0 +1,194 @@
|
||||
package com.hbm.handler.guncfg;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBulletBase;
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.interfaces.IBulletImpactBehavior;
|
||||
import com.hbm.interfaces.IBulletUpdateBehavior;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class GunNPCFactory {
|
||||
|
||||
public static BulletConfiguration getMaskmanOrb() {
|
||||
|
||||
BulletConfiguration bullet = new BulletConfiguration();
|
||||
|
||||
bullet.ammo = ModItems.coin_maskman;
|
||||
bullet.velocity = 0.25F;
|
||||
bullet.spread = 0.000F;
|
||||
bullet.wear = 10;
|
||||
bullet.bulletsMin = 1;
|
||||
bullet.bulletsMax = 1;
|
||||
bullet.dmgMin = 100;
|
||||
bullet.dmgMax = 100;
|
||||
bullet.gravity = 0.0D;
|
||||
bullet.maxAge = 60;
|
||||
bullet.doesRicochet = false;
|
||||
bullet.ricochetAngle = 0;
|
||||
bullet.HBRC = 0;
|
||||
bullet.LBRC = 0;
|
||||
bullet.bounceMod = 1.0;
|
||||
bullet.doesPenetrate = false;
|
||||
bullet.doesBreakGlass = false;
|
||||
bullet.style = BulletConfiguration.STYLE_ORB;
|
||||
bullet.trail = 1;
|
||||
bullet.explosive = 1.5F;
|
||||
|
||||
bullet.bUpdate = new IBulletUpdateBehavior() {
|
||||
|
||||
@Override
|
||||
public void behaveUpdate(EntityBulletBase bullet) {
|
||||
|
||||
if(bullet.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
if(bullet.ticksExisted % 10 != 5)
|
||||
return;
|
||||
|
||||
List<EntityPlayer> players = bullet.worldObj.getEntitiesWithinAABB(EntityPlayer.class, bullet.boundingBox.expand(50, 50, 50));
|
||||
|
||||
for(EntityPlayer player : players) {
|
||||
|
||||
Vec3 motion = Vec3.createVectorHelper(player.posX - bullet.posX, (player.posY + player.getEyeHeight()) - bullet.posY, player.posZ - bullet.posZ);
|
||||
motion = motion.normalize();
|
||||
|
||||
EntityBulletBase bolt = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_BOLT);
|
||||
bolt.shooter = bullet.shooter;
|
||||
bolt.setPosition(bullet.posX, bullet.posY, bullet.posZ);
|
||||
bolt.setThrowableHeading(motion.xCoord, motion.yCoord, motion.zCoord, 0.5F, 0.05F);
|
||||
bullet.worldObj.spawnEntityInWorld(bolt);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public static BulletConfiguration getMaskmanBolt() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
|
||||
bullet.ammo = ModItems.coin_maskman;
|
||||
bullet.spread = 0.0F;
|
||||
bullet.dmgMin = 15;
|
||||
bullet.dmgMax = 20;
|
||||
bullet.wear = 10;
|
||||
bullet.leadChance = 0;
|
||||
bullet.explosive = 0.5F;
|
||||
bullet.setToBolt(BulletConfiguration.BOLT_LACUNAE);
|
||||
bullet.vPFX = "reddust";
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public static BulletConfiguration getMaskmanBullet() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
|
||||
bullet.ammo = ModItems.coin_maskman;
|
||||
bullet.spread = 0.0F;
|
||||
bullet.dmgMin = 5;
|
||||
bullet.dmgMax = 10;
|
||||
bullet.wear = 10;
|
||||
bullet.leadChance = 15;
|
||||
bullet.style = BulletConfiguration.STYLE_FLECHETTE;
|
||||
bullet.vPFX = "bluedust";
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public static BulletConfiguration getMaskmanTracer() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
|
||||
bullet.ammo = ModItems.coin_maskman;
|
||||
bullet.spread = 0.0F;
|
||||
bullet.dmgMin = 15;
|
||||
bullet.dmgMax = 20;
|
||||
bullet.wear = 10;
|
||||
bullet.leadChance = 0;
|
||||
bullet.setToBolt(BulletConfiguration.BOLT_NIGHTMARE);
|
||||
bullet.vPFX = "reddust";
|
||||
|
||||
bullet.bImpact = new IBulletImpactBehavior() {
|
||||
|
||||
@Override
|
||||
public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) {
|
||||
|
||||
if(bullet.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
EntityBulletBase meteor = new EntityBulletBase(bullet.worldObj, BulletConfigSyncingUtil.MASKMAN_METEOR);
|
||||
meteor.setPosition(bullet.posX, bullet.posY + 30 + meteor.worldObj.rand.nextInt(10), bullet.posZ);
|
||||
meteor.motionY = -1D;
|
||||
meteor.shooter = bullet.shooter;
|
||||
bullet.worldObj.spawnEntityInWorld(meteor);
|
||||
}
|
||||
};
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public static BulletConfiguration getMaskmanRocket() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
|
||||
|
||||
bullet.ammo = ModItems.coin_maskman;
|
||||
bullet.gravity = 0.1D;
|
||||
bullet.velocity = 1.0F;
|
||||
bullet.dmgMin = 15;
|
||||
bullet.dmgMax = 20;
|
||||
bullet.blockDamage = false;
|
||||
bullet.explosive = 5.0F;
|
||||
bullet.style = BulletConfiguration.STYLE_ROCKET;
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public static BulletConfiguration getMaskmanMeteor() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
|
||||
|
||||
bullet.ammo = ModItems.coin_maskman;
|
||||
bullet.gravity = 0.1D;
|
||||
bullet.velocity = 1.0F;
|
||||
bullet.dmgMin = 20;
|
||||
bullet.dmgMax = 30;
|
||||
bullet.incendiary = 3;
|
||||
bullet.explosive = 2.5F;
|
||||
bullet.style = BulletConfiguration.STYLE_METEOR;
|
||||
|
||||
bullet.bUpdate = new IBulletUpdateBehavior() {
|
||||
|
||||
@Override
|
||||
public void behaveUpdate(EntityBulletBase bullet) {
|
||||
|
||||
if(!bullet.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
Random rand = bullet.worldObj.rand;
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setString("type", "vanillaExt");
|
||||
nbt.setString("mode", "flame");
|
||||
nbt.setDouble("posX", bullet.posX + rand.nextDouble() * 0.5 - 0.25);
|
||||
nbt.setDouble("posY", bullet.posY + rand.nextDouble() * 0.5 - 0.25);
|
||||
nbt.setDouble("posZ", bullet.posZ + rand.nextDouble() * 0.5 - 0.25);
|
||||
MainRegistry.proxy.effectNT(nbt);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1159,11 +1159,13 @@ public class ModItems {
|
||||
public static Item ammo_556_ap;
|
||||
public static Item ammo_556_du;
|
||||
public static Item ammo_556_star;
|
||||
public static Item ammo_556_sleek;
|
||||
public static Item ammo_556_tracer;
|
||||
public static Item ammo_556_flechette;
|
||||
public static Item ammo_556_flechette_incendiary;
|
||||
public static Item ammo_556_flechette_phosphorus;
|
||||
public static Item ammo_556_flechette_du;
|
||||
public static Item ammo_556_flechette_sleek;
|
||||
public static Item ammo_556_k;
|
||||
public static Item ammo_22lr;
|
||||
public static Item ammo_22lr_ap;
|
||||
@ -1178,6 +1180,7 @@ public class ModItems {
|
||||
public static Item ammo_50bmg_ap;
|
||||
public static Item ammo_50bmg_du;
|
||||
public static Item ammo_50bmg_star;
|
||||
public static Item ammo_50bmg_sleek;
|
||||
public static Item ammo_folly;
|
||||
public static Item ammo_folly_nuclear;
|
||||
public static Item ammo_folly_du;
|
||||
@ -2968,11 +2971,13 @@ public class ModItems {
|
||||
ammo_556_ap = new ItemAmmo().setUnlocalizedName("ammo_556_ap").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_ap");
|
||||
ammo_556_du = new ItemAmmo().setUnlocalizedName("ammo_556_du").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_du");
|
||||
ammo_556_star = new ItemAmmo().setUnlocalizedName("ammo_556_star").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_star");
|
||||
ammo_556_sleek = new ItemAmmo().setUnlocalizedName("ammo_556_sleek").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_sleek");
|
||||
ammo_556_tracer = new ItemAmmo().setUnlocalizedName("ammo_556_tracer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_tracer");
|
||||
ammo_556_flechette = new ItemAmmo().setUnlocalizedName("ammo_556_flechette").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_flechette");
|
||||
ammo_556_flechette_incendiary = new ItemAmmo().setUnlocalizedName("ammo_556_flechette_incendiary").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_flechette_incendiary");
|
||||
ammo_556_flechette_phosphorus = new ItemAmmo().setUnlocalizedName("ammo_556_flechette_phosphorus").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_flechette_phosphorus");
|
||||
ammo_556_flechette_du = new ItemAmmo().setUnlocalizedName("ammo_556_flechette_du").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_flechette_du");
|
||||
ammo_556_flechette_sleek = new ItemAmmo().setUnlocalizedName("ammo_556_flechette_sleek").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_flechette_sleek");
|
||||
ammo_556_k = new ItemAmmo().setUnlocalizedName("ammo_556_k").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_556_k");
|
||||
ammo_50ae = new ItemAmmo().setUnlocalizedName("ammo_50ae").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50ae");
|
||||
ammo_50ae_ap = new ItemAmmo().setUnlocalizedName("ammo_50ae_ap").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50ae_ap");
|
||||
@ -2985,6 +2990,7 @@ public class ModItems {
|
||||
ammo_50bmg_ap = new ItemAmmo().setUnlocalizedName("ammo_50bmg_ap").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50bmg_ap");
|
||||
ammo_50bmg_du = new ItemAmmo().setUnlocalizedName("ammo_50bmg_du").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50bmg_du");
|
||||
ammo_50bmg_star = new ItemAmmo().setUnlocalizedName("ammo_50bmg_star").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50bmg_star");
|
||||
ammo_50bmg_sleek = new ItemAmmo().setUnlocalizedName("ammo_50bmg_sleek").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_50bmg_sleek");
|
||||
ammo_357_desh = new ItemAmmo().setUnlocalizedName("ammo_357_desh").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_357_desh");
|
||||
ammo_44 = new ItemAmmo().setUnlocalizedName("ammo_44").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_44");
|
||||
ammo_44_ap = new ItemAmmo().setUnlocalizedName("ammo_44_ap").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_44_ap");
|
||||
@ -3075,7 +3081,7 @@ public class ModItems {
|
||||
gun_fatman = new ItemGunBase(GunFatmanFactory.getFatmanConfig()).setUnlocalizedName("gun_fatman").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_fatman");
|
||||
gun_proto = new ItemGunBase(GunFatmanFactory.getProtoConfig()).setUnlocalizedName("gun_proto").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_fatman");
|
||||
gun_mirv_ammo = new Item().setUnlocalizedName("gun_mirv_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mirv_ammo");
|
||||
gun_mirv = new ItemGunBase(GunFatmanFactory.getFatmanConfig()).setUnlocalizedName("gun_mirv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mirv");
|
||||
gun_mirv = new ItemGunBase(GunFatmanFactory.getMIRVConfig()).setUnlocalizedName("gun_mirv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mirv");
|
||||
gun_bf_ammo = new Item().setUnlocalizedName("gun_bf_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_bf_ammo");
|
||||
gun_bf = new ItemGunBase(GunFatmanFactory.getBELConfig()).setUnlocalizedName("gun_bf").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_bf");
|
||||
gun_mp40_ammo = new Item().setUnlocalizedName("gun_mp40_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_mp40_ammo");
|
||||
@ -5189,11 +5195,13 @@ public class ModItems {
|
||||
GameRegistry.registerItem(ammo_556_ap, ammo_556_ap.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_556_du, ammo_556_du.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_556_star, ammo_556_star.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_556_sleek, ammo_556_sleek.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_556_tracer, ammo_556_tracer.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_556_flechette, ammo_556_flechette.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_556_flechette_incendiary, ammo_556_flechette_incendiary.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_556_flechette_phosphorus, ammo_556_flechette_phosphorus.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_556_flechette_du, ammo_556_flechette_du.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_556_flechette_sleek, ammo_556_flechette_sleek.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_556_k, ammo_556_k.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_22lr, ammo_22lr.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_22lr_ap, ammo_22lr_ap.getUnlocalizedName());
|
||||
@ -5208,6 +5216,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(ammo_50bmg_ap, ammo_50bmg_ap.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_50bmg_du, ammo_50bmg_du.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_50bmg_star, ammo_50bmg_star.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_50bmg_sleek, ammo_50bmg_sleek.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_fuel, ammo_fuel.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_fuel_napalm, ammo_fuel_napalm.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ammo_fuel_phosphorus, ammo_fuel_phosphorus.getUnlocalizedName());
|
||||
|
||||
@ -220,6 +220,9 @@ public class ItemAmmo extends Item {
|
||||
list.add(EnumChatFormatting.YELLOW + "* Starmetal");
|
||||
list.add(EnumChatFormatting.RED + "- Highly increased wear");
|
||||
}
|
||||
if(this == ModItems.ammo_50bmg_sleek) {
|
||||
list.add(EnumChatFormatting.YELLOW + "* Fires a high-damage round that summons a small meteorite");
|
||||
}
|
||||
|
||||
//.50 AE
|
||||
if(this == ModItems.ammo_50ae_ap) {
|
||||
@ -382,6 +385,9 @@ public class ItemAmmo extends Item {
|
||||
list.add(EnumChatFormatting.YELLOW + "* Starmetal");
|
||||
list.add(EnumChatFormatting.RED + "- Highly increased wear");
|
||||
}
|
||||
if(this == ModItems.ammo_556_sleek) {
|
||||
list.add(EnumChatFormatting.YELLOW + "* Fires a high-damage round that summons a small meteorite");
|
||||
}
|
||||
if(this == ModItems.ammo_556_flechette) {
|
||||
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
|
||||
list.add(EnumChatFormatting.YELLOW + "* Less bouncy");
|
||||
@ -410,6 +416,9 @@ public class ItemAmmo extends Item {
|
||||
list.add(EnumChatFormatting.YELLOW + "* Less bouncy");
|
||||
list.add(EnumChatFormatting.RED + "- Highly increased wear");
|
||||
}
|
||||
if(this == ModItems.ammo_556_flechette_sleek) {
|
||||
list.add(EnumChatFormatting.YELLOW + "* Fires a high-damage round that summons a small meteorite");
|
||||
}
|
||||
if(this == ModItems.ammo_556_tracer) {
|
||||
list.add(EnumChatFormatting.YELLOW + "* Tracer");
|
||||
}
|
||||
|
||||
@ -858,6 +858,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50bmg_ap, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_50bmg, 'A', ModItems.ingot_dura_steel });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50bmg_du, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_50bmg, 'A', ModItems.ingot_u238 });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50bmg_star, 4), new Object[] { " B ", "BAB", " B ", 'B', ModItems.ammo_50bmg_du, 'A', ModItems.ingot_starmetal });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50bmg_sleek, 64), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_50bmg, 'A', ModItems.coin_maskman });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50ae_ap, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_50ae, 'A', ModItems.ingot_dura_steel });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50ae_du, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_50ae, 'A', ModItems.ingot_u238 });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_50ae_star, 4), new Object[] { " B ", "BAB", " B ", 'B', ModItems.ammo_50ae_du, 'A', ModItems.ingot_starmetal });
|
||||
@ -865,11 +866,13 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_ap, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556, 'A', ModItems.ingot_dura_steel });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_du, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556, 'A', ModItems.ingot_u238 });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_star, 4), new Object[] { " B ", "BAB", " B ", 'B', ModItems.ammo_556_du, 'A', ModItems.ingot_starmetal });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_sleek, 64), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556, 'A', ModItems.coin_maskman });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_tracer, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556, 'A', Items.redstone });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_flechette, 4), new Object[] { " B ", "BAB", " B ", 'B', ModItems.ammo_556, 'A', ModItems.pellet_flechette });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_flechette_incendiary, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556_flechette, 'A', ModItems.powder_fire });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_flechette_phosphorus, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556_flechette, 'A', ModItems.ingot_phosphorus });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_flechette_du, 8), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556_flechette, 'A', ModItems.ingot_u238 });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_556_flechette_sleek, 64), new Object[] { "BBB", "BAB", "BBB", 'B', ModItems.ammo_556_flechette, 'A', ModItems.coin_maskman });
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.folly_bullet, 1), new Object[] { " S ", "STS", "SMS", 'S', ModItems.ingot_starmetal, 'T', ModItems.powder_magic, 'M', ModBlocks.block_meteor });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.folly_bullet_nuclear, 1), new Object[] { " N ", "UTU", "UTU", 'N', ModItems.gun_fatman_ammo, 'U', "ingotIron", 'T', "blockTungsten" }));
|
||||
|
||||
@ -96,6 +96,9 @@ public class ResourceManager {
|
||||
public static final IModelCustom sphere_uv = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sphere_uv.obj"));
|
||||
public static final IModelCustom sphere_uv_anim = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sphere_uv.hmf"));
|
||||
|
||||
//Meteor
|
||||
public static final IModelCustom meteor = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/weapons/meteor.obj"));
|
||||
|
||||
//Radgen
|
||||
public static final IModelCustom radgen_body = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/rad_gen_body.obj"));
|
||||
public static final IModelCustom radgen_rotor = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/rad_gen_rotor.obj"));
|
||||
|
||||
@ -70,6 +70,7 @@ public class RenderBullet extends Render {
|
||||
case BulletConfiguration.STYLE_MIRV: renderNuke(1); break;
|
||||
case BulletConfiguration.STYLE_BF: renderNuke(2); break;
|
||||
case BulletConfiguration.STYLE_ORB: renderOrb(trail); break;
|
||||
case BulletConfiguration.STYLE_METEOR: renderMeteor(trail); break;
|
||||
default: renderBullet(trail); break;
|
||||
}
|
||||
|
||||
@ -190,6 +191,19 @@ public class RenderBullet extends Render {
|
||||
for(int i = 0; i < 5; i++)
|
||||
RenderSparks.renderSpark((int) (System.currentTimeMillis() / 100 + 100 * i), 0, 0, 0, 0.5F, 2, 2, 0x8080FF, 0xFFFFFF);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glColor4f(0.5F, 0.0F, 0.0F, 0.5F);
|
||||
ResourceManager.sphere_uv.renderAll();
|
||||
GL11.glScalef(0.75F, 0.75F, 0.75F);
|
||||
ResourceManager.sphere_uv.renderAll();
|
||||
GL11.glScalef(1F/0.75F, 1F/0.75F, 1F/0.75F);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
for(int i = 0; i < 3; i++)
|
||||
RenderSparks.renderSpark((int) (System.currentTimeMillis() / 100 + 100 * i), 0, 0, 0, 1F, 2, 3, 0xFF0000, 0xFF8080);
|
||||
break;
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
@ -198,6 +212,23 @@ public class RenderBullet extends Render {
|
||||
|
||||
}
|
||||
|
||||
private void renderMeteor(int type) {
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
switch(type) {
|
||||
case 0:
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/blocks/block_meteor_molten.png")); break;
|
||||
case 1:
|
||||
bindTexture(new ResourceLocation("textures/blocks/obsidian.png")); break;
|
||||
}
|
||||
|
||||
ResourceManager.meteor.renderAll();
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
private void renderFlechette() {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
|
||||
@ -10,17 +10,14 @@ import net.minecraft.world.WorldSavedData;
|
||||
public class AuxSavedData extends WorldSavedData {
|
||||
|
||||
public List<DataPair> data = new ArrayList();
|
||||
|
||||
private World worldObj;
|
||||
|
||||
public AuxSavedData(String p_i2141_1_) {
|
||||
super(p_i2141_1_);
|
||||
}
|
||||
|
||||
public AuxSavedData(World p_i1678_1_)
|
||||
public AuxSavedData()
|
||||
{
|
||||
super("hbmauxdata");
|
||||
this.worldObj = p_i1678_1_;
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
@ -75,7 +72,7 @@ public class AuxSavedData extends WorldSavedData {
|
||||
|
||||
AuxSavedData data = (AuxSavedData)worldObj.perWorldStorage.loadData(AuxSavedData.class, "hbmauxdata");
|
||||
if(data == null) {
|
||||
worldObj.perWorldStorage.setData("hbmauxdata", new AuxSavedData(worldObj));
|
||||
worldObj.perWorldStorage.setData("hbmauxdata", new AuxSavedData());
|
||||
|
||||
data = (AuxSavedData)worldObj.perWorldStorage.loadData(AuxSavedData.class, "hbmauxdata");
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSavedData;
|
||||
|
||||
public class BroadcastSavedData extends WorldSavedData {
|
||||
@ -12,17 +11,14 @@ public class BroadcastSavedData extends WorldSavedData {
|
||||
public int bcCount;
|
||||
|
||||
public List<BroadcastSaveStructure> broadcasts = new ArrayList();
|
||||
|
||||
private World worldObj;
|
||||
|
||||
public BroadcastSavedData(String p_i2141_1_) {
|
||||
super(p_i2141_1_);
|
||||
}
|
||||
|
||||
public BroadcastSavedData(World p_i1678_1_)
|
||||
public BroadcastSavedData()
|
||||
{
|
||||
super("broadcasts");
|
||||
this.worldObj = p_i1678_1_;
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
|
||||
@ -12,17 +12,14 @@ import net.minecraft.world.WorldSavedData;
|
||||
public class SatelliteSavedData extends WorldSavedData {
|
||||
|
||||
public HashMap<Integer, Satellite> sats = new HashMap();
|
||||
|
||||
private World worldObj;
|
||||
|
||||
public SatelliteSavedData(String p_i2141_1_) {
|
||||
super(p_i2141_1_);
|
||||
}
|
||||
|
||||
public SatelliteSavedData(World p_i1678_1_)
|
||||
public SatelliteSavedData()
|
||||
{
|
||||
super("satellites");
|
||||
this.worldObj = p_i1678_1_;
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
@ -73,13 +70,11 @@ public class SatelliteSavedData extends WorldSavedData {
|
||||
|
||||
SatelliteSavedData data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
|
||||
if(data == null) {
|
||||
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData(worldObj));
|
||||
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData());
|
||||
|
||||
data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
|
||||
}
|
||||
|
||||
data.worldObj = worldObj;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@ -542,7 +542,7 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
|
||||
|
||||
SatelliteSavedData data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
|
||||
if(data == null) {
|
||||
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData(worldObj));
|
||||
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData());
|
||||
data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
|
||||
}
|
||||
data.markDirty();
|
||||
|
||||
@ -199,7 +199,7 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
|
||||
data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
|
||||
|
||||
if(data == null) {
|
||||
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData(worldObj));
|
||||
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData());
|
||||
data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
|
||||
}
|
||||
data.markDirty();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user