2018-09-13 12:03:28 -04:00
|
|
|
package noppes.npcs.scripted.roles;
|
|
|
|
|
|
2023-01-08 22:32:36 -06:00
|
|
|
import noppes.npcs.api.handler.data.IModelPart;
|
2018-09-13 12:03:28 -04:00
|
|
|
import noppes.npcs.entity.EntityNPCInterface;
|
|
|
|
|
import noppes.npcs.roles.JobPuppet;
|
|
|
|
|
import noppes.npcs.scripted.constants.JobType;
|
2022-11-15 15:25:53 -05:00
|
|
|
import noppes.npcs.api.jobs.IJobPuppet;
|
2018-09-13 12:03:28 -04:00
|
|
|
|
2022-06-12 01:26:23 -05:00
|
|
|
public class ScriptJobPuppet extends ScriptJobInterface implements IJobPuppet {
|
2018-09-13 12:03:28 -04:00
|
|
|
private JobPuppet job;
|
|
|
|
|
public ScriptJobPuppet(EntityNPCInterface npc){
|
|
|
|
|
super(npc);
|
|
|
|
|
this.job = (JobPuppet) npc.jobInterface;
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-08 22:32:36 -06:00
|
|
|
public IModelPart getPart(int part) {
|
|
|
|
|
switch (part) {
|
|
|
|
|
case 0:
|
|
|
|
|
return job.head;
|
|
|
|
|
case 1:
|
|
|
|
|
return job.body;
|
|
|
|
|
case 2:
|
|
|
|
|
return job.larm;
|
|
|
|
|
case 3:
|
|
|
|
|
return job.rarm;
|
|
|
|
|
case 4:
|
|
|
|
|
return job.lleg;
|
|
|
|
|
case 5:
|
|
|
|
|
return job.rleg;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
2022-12-22 01:36:50 -06:00
|
|
|
}
|
|
|
|
|
|
2023-01-08 23:00:25 -06:00
|
|
|
public void allAnimated(boolean animated) {
|
2023-01-08 22:32:36 -06:00
|
|
|
for (int i = 0; i < 6; i++) {
|
|
|
|
|
this.getPart(i).setAnimated(animated);
|
|
|
|
|
}
|
2023-01-07 13:13:44 -06:00
|
|
|
}
|
|
|
|
|
|
2023-01-08 23:00:25 -06:00
|
|
|
public void allInterpolated(boolean interpolate) {
|
2023-01-08 22:32:36 -06:00
|
|
|
for (int i = 0; i < 6; i++) {
|
|
|
|
|
this.getPart(i).setAnimated(interpolate);
|
|
|
|
|
}
|
2022-12-22 17:04:53 -06:00
|
|
|
}
|
|
|
|
|
|
2023-01-08 23:00:25 -06:00
|
|
|
public void allFullAngles(boolean fullAngles) {
|
2023-01-08 22:32:36 -06:00
|
|
|
for (int i = 0; i < 6; i++) {
|
|
|
|
|
this.getPart(i).setFullAngles(fullAngles);
|
|
|
|
|
}
|
2022-12-22 01:36:50 -06:00
|
|
|
}
|
|
|
|
|
|
2023-01-08 23:00:25 -06:00
|
|
|
public void allAnimRate(float animRate) {
|
2023-01-07 13:13:44 -06:00
|
|
|
if (animRate < 0)
|
|
|
|
|
animRate = 0;
|
2023-01-08 22:32:36 -06:00
|
|
|
for (int i = 0; i < 6; i++) {
|
|
|
|
|
this.getPart(i).setAnimRate(animRate);
|
|
|
|
|
}
|
2022-12-22 01:36:50 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void doWhileStanding(boolean whileStanding) {
|
|
|
|
|
this.job.whileStanding = whileStanding;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean doWhileStanding() {
|
|
|
|
|
return this.job.whileStanding;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void doWhileAttacking(boolean whileAttacking) {
|
|
|
|
|
this.job.whileAttacking = whileAttacking;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean doWhileAttacking() {
|
|
|
|
|
return this.job.whileAttacking;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void doWhileMoving(boolean whileMoving) {
|
|
|
|
|
this.job.whileMoving = whileMoving;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean doWhileMoving() {
|
|
|
|
|
return this.job.whileMoving;
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-08 22:32:36 -06:00
|
|
|
@Deprecated
|
|
|
|
|
public void setRotationX(int part, float rotation) {
|
|
|
|
|
this.getPart(part).setRotationX(rotation);
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|
2022-12-22 17:04:53 -06:00
|
|
|
|
2023-01-08 22:32:36 -06:00
|
|
|
@Deprecated
|
|
|
|
|
public void setRotationY(int part, float rotation) {
|
|
|
|
|
this.getPart(part).setRotationY(rotation);
|
2022-12-22 17:04:53 -06:00
|
|
|
}
|
|
|
|
|
|
2023-01-08 22:32:36 -06:00
|
|
|
@Deprecated
|
|
|
|
|
public void setRotationZ(int part, float rotation) {
|
|
|
|
|
this.getPart(part).setRotationZ(rotation);
|
2022-12-22 17:04:53 -06:00
|
|
|
}
|
|
|
|
|
|
2023-01-08 22:32:36 -06:00
|
|
|
@Deprecated
|
|
|
|
|
public float getRotationX(int part) {
|
|
|
|
|
return this.getPart(part).getRotationX();
|
2022-12-22 17:04:53 -06:00
|
|
|
}
|
|
|
|
|
|
2023-01-08 22:32:36 -06:00
|
|
|
@Deprecated
|
|
|
|
|
public float getRotationY(int part) {
|
|
|
|
|
return this.getPart(part).getRotationY();
|
2022-12-22 17:04:53 -06:00
|
|
|
}
|
|
|
|
|
|
2023-01-08 22:32:36 -06:00
|
|
|
@Deprecated
|
|
|
|
|
public float getRotationZ(int part) {
|
|
|
|
|
return this.getPart(part).getRotationZ();
|
2022-12-22 17:04:53 -06:00
|
|
|
}
|
|
|
|
|
|
2023-01-08 22:32:36 -06:00
|
|
|
@Deprecated
|
|
|
|
|
public boolean isEnabled(int part) {
|
|
|
|
|
return this.getPart(part).isEnabled();
|
2022-12-22 17:04:53 -06:00
|
|
|
}
|
|
|
|
|
|
2023-01-08 22:32:36 -06:00
|
|
|
@Deprecated
|
|
|
|
|
public void setEnabled(int part, boolean bo) {
|
|
|
|
|
this.getPart(part).setEnabled(bo);
|
2022-12-22 17:04:53 -06:00
|
|
|
}
|
|
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
@Override
|
|
|
|
|
public int getType(){
|
|
|
|
|
return JobType.PUPPET;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|