-
Notifications
You must be signed in to change notification settings - Fork 27
/
five.txt
105 lines (96 loc) · 4.63 KB
/
five.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
DerivativeUnitFactory.java
TextureRegion arm = Core.atlas.find(name + "-arm");
TextureRegion hand = Core.atlas.find(name + "-hand");
if(arm.found()) {
float ag = 90 * rotation - 90;
float angle = ag + baseAng;
float armAng = angle + shiftAng;
float ax = x + Angles.trnsx(ag, startX, startY), ay = y + Angles.trnsy(ag, startX, startY);
float armLen = (float) arm.height / tilesize;
Draw.rect(arm, ax, ay, armAng);
ax = EUGet.dx(ax, armLen, armAng + 90);
ay = EUGet.dy(ay, armLen, armAng + 90);
v1.set(ax, ay);
Vec2 v = getUnitSpawn();
float handAng = v1.angleTo(v.x, v.y);
Draw.rect(hand, v1, handAng - 90);
float z = Draw.z();
if(currentPlan != -1) {
UnitPlan plan = plans.get(currentPlan);
Draw.draw(Layer.blockOver, () -> Drawf.construct(v.x, v.y, plan.unit.fullIcon, rotdeg() - 90f, progress / plan.time, speedScl, time));
Draw.color(Pal.accent);
Draw.z(Layer.buildBeam);
float
px = ax + Angles.trnsx(handAng, hand.height / 8f),
py = ay + Angles.trnsy(handAng, hand.height / 8f);
if(efficiency > 0.01f) {
Fill.circle(x, y, 3 * efficiency * speedScl);
Drawf.buildBeam(x, y, v.x, v.y, plan.unit.hitSize / 2f * efficiency * speedScl);
}
}
Draw.z(z);
}
next
CopyMemoryBuild.java
public class CopyMemoryBuild extends MemoryBlock.MemoryBuild {
MemoryBlock mb;
public Object[] objects;
public CopyMemoryBuild(MemoryBlock mb) {
mb.super();
this.mb = mb;
objects = new Object[mb.memoryCapacity];
}
public void updateMemory() {
for (int i = 0; i < memory.length; i++) {
objects[i] = memory[i];
}
}
@Override
public Object[] config() {
updateMemory();
return objects;
}
}
override
if(Vars.content.blocks().size > 0){
for(Block b : Vars.content.blocks()){
if(b instanceof MemoryBlock mb && mb.buildType.get().getClass() == MemoryBlock.MemoryBuild.class){
mb.buildType = () -> new CopyMemoryBuild((mb));
mb.config(Object[].class, (CopyMemoryBuild e, Object[] ds) -> {
for(int i = 0; i < ds.length; i++){
if(ds[i] instanceof Double d)
e.memory[i] = d;
}
});
mb.description += Core.bundle.get("override.memory-block");
}
}
}
mgs
// if(b.timer.get(1,4)){
// for(int i = 0; i < 3; i++){
// Lightning.create(b.team, cor, damages[1], b.x + Mathf.random(-40,40), b.y + Mathf.random(-40,40), Mathf.random(360), Mathf.random(8,20));
// }
// for(int i = 0; i < 5; i++){
// Lightning.create(b.team, liC, damages[0], b.x + Mathf.random(-40,40), b.y + Mathf.random(-40,40), Mathf.random(360), Mathf.random(5,10));
// }
// for(int i = 0; i < 7; i++){
// Lightning.create(b.team, cor, damages[2], b.x + Mathf.random(-40,40), b.y + Mathf.random(-40,40), Mathf.random(360), Mathf.random(3,7));
// }
// if(Mathf.chance(Time.delta * 0.075)){
// int len = Mathf.random(1, 7);
// float a = b.rotation() + Mathf.range(fragSpread/2) + fragAngle;
// Lightning.create(b.team, liC, damages[0], b.x - Angles.trnsx(a, len), b.y - Angles.trnsy(a, len), a, (int) (0.5 + Mathf.random(14)));
// }
// }
// @Override
// public void despawned(Bullet b) {
// super.despawned(b);
// //despawnEffect.at(b.x, b.y, b.rotation());
// for(int i = 0; i < 12; i++){
// Lightning.create(b.team, cor, damages[3], b.x , b.y , Mathf.random(360), Mathf.random(10, 25));
// int len = Mathf.random(1, 7);
// float a = b.rotation() + Mathf.range(fragSpread/2) + fragAngle;
// Lightning.create(b.team, liC, damages[3], b.x - Angles.trnsx(a, len), b.y - Angles.trnsy(a, len), a, (int) (0.5 + Mathf.random(14)));
// }
// }