MPP 25 if runeIn id 100000 MP MPP gotMP connectMode xwii round round s

  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
MPP = 25;
if (runeIn[id - 100000] == 0 && MP >= MPP && gotMP == 0 && connectMode == 0) {
xwii = round(x + round(sprite_width / 2));
ywii = round(y + round(sprite_height / 2));
runeIn[id - 100000] = instance_create(xwii, ywii, runes[selected]);
runeIn[id - 100000, obj] = runes[selected];
runeState[runeIn[id - 100000] - 100000] = 1;
runeCoords[runeIn[id - 100000] - 100000, 0] = runePlaceCoords[id - 100000, 0];
runeCoords[runeIn[id - 100000] - 100000, 1] = runePlaceCoords[id - 100000, 1];
with (runeIn[id - 100000]) {
image_speed = 30 / 21 / 4;
}
MP -= MPP;
}
gotMP = 0;
if (connectMode > 0 && runeIn[id - 100000] > 0) {
if (mouse_check_button(mb_right)) {
connectMode = 0;
connectObject = 0;
continue;
} else {
connectedNum = 0;
connectIn = 0;
connectedNum2 = 0;
connectIn2 = 0;
alreadyConnected = 0;
for (i = 0; i < 5; i += 1) {
if (runeConnected[connectMode - 100000, i] != 0) {
connectedNum += 1;
} else {
connectIn = i;
}
if (runeConnected[connectMode - 100000, i] == runeIn[id - 100000]) alreadyConnected = 1;
}
for (i = 0; i < 5; i += 1) {
if (runeConnected[runeIn[id - 100000] - 100000, i] != 0) {
connectedNum2 += 1;
} else {
connectIn2 = i;
}
if (runeConnected[runeIn[id - 100000] - 100000, i] == connectMode) alreadyConnected = 1;
}
xRune1 = runeCoords[connectMode - 100000, 0];
yRune1 = runeCoords[connectMode - 100000, 1];
xRune2 = runeCoords[runeIn[id - 100000] - 100000, 0];
yRune2 = runeCoords[runeIn[id - 100000] - 100000, 1];
if ((xRune1 == xRune2 && (yRune2 == (yRune1 - 1) || yRune2 == (yRune1 + 1))) || (yRune1 == yRune2 && (xRune2 == (xRune1 - 1) || xRune2 == (xRune1 + 1)))) {
goodPosition = 1;
} else goodPosition = 0;
if (runeInfo[connectObject, maxConnections] > connectedNum && runeInfo[runeIn[id - 100000, obj], maxConnections] > connectedNum2 && goodPosition == 1 && alreadyConnected = 0) {
runeConnected[connectMode - 100000, connectIn] = runeIn[id - 100000];
runeConnected[runeIn[id - 100000] - 100000, connectIn2] = connectMode;
chargeRune = 0;
chargeRuneObj = 0;
notChargeRune = 0;
notChargeRuneObj = 0;
if (runeIn[id - 100000, obj] == runeCharge) {
runeInfo[connectMode - 100000, powerSource] = runeIn[id - 100000];
runeInfo[runeIn[id - 100000] - 100000, chainLength] += 1;
chargeRune = runeIn[id - 100000];
chargeRuneObj = runeIn[id - 100000, obj];
notChargeRune = connectMode;
notChargeRuneObj = connectObject;
}
if (connectObject == runeCharge) {
runeInfo[runeIn[id - 100000] - 100000, powerSource] = connectMode;
runeInfo[connectMode - 100000, chainLength] += 1;
chargeRune = connectMode;
chargeRuneObj = connectObject;
notChargeRune = runeIn[id - 100000];
notChargeRuneObj = runeIn[id - 100000, obj];
}
if (runeInfo[connectMode - 100000, powerSource] > 0) {
chargeRune = runeInfo[connectMode - 100000, powerSource];
chargeRuneObj = runeCharge;
notChargeRune = runeIn[id - 100000];
notChargeRuneObj = connectObject;
}
if (runeInfo[runeIn[id - 100000] - 100000, powerSource] > 0) {
chargeRune = runeInfo[runeIn[id - 100000] - 100000, powerSource];
chargeRuneObj = runeCharge;
notChargeRune = connectMode;
notChargeRuneObj = runeIn[id - 100000, obj];
}
if (chargeRune > 0) {
if (runeInfo[chargeRuneObj, chainLengthMax] > runeInfo[chargeRune - 100000, chainLength]) {
runeInfo[chargeRune - 100000, chainLength] += 1;
runeInfo[notChargeRune - 100000, powerSource] = chargeRune;
}
}
connectMode = 0;
}
}
}
if (keyboard_check(vk_control) && connectMode == 0 && runeIn[id - 100000] > 0) {
connectMode = runeIn[id - 100000];
connectObject = runeIn[id - 100000, obj];
}