Skip to content

Commit

Permalink
added digger zombie to some i, zombie levels, added magnet shroom bac…
Browse files Browse the repository at this point in the history
…k to i, zombie levels and fixed up wallnut level
  • Loading branch information
ROBlNET13 committed Dec 8, 2024
1 parent f16734a commit ec3b5b7
Show file tree
Hide file tree
Showing 27 changed files with 660 additions and 56 deletions.
File renamed without changes
Binary file added game/images/Card/Zombies/IDiggerzombie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added game/images/Plants/Ms/Ms.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Plants/Ms/attack.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Plants/Ms/sle.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Plants/Ms/sleep.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Zombies/Diggerzombie/0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Zombies/Diggerzombie/Attack1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Zombies/Diggerzombie/Attack2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Zombies/Diggerzombie/BoomDie.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Zombies/Diggerzombie/Die.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Zombies/Diggerzombie/Down.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Zombies/Diggerzombie/Down1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Zombies/Diggerzombie/Up.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Zombies/Diggerzombie/Walk1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Zombies/Diggerzombie/Walk2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/images/Zombies/Diggerzombie/Walk3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
169 changes: 169 additions & 0 deletions game/js/CPlants.js
Original file line number Diff line number Diff line change
Expand Up @@ -10255,3 +10255,172 @@ oFlowerVase = InheritO(CPlants, {
return true;
},
});
(oMagnetShroom = InheritO(CPlants, {
EName: "oMagnetShroom",
CName: "MagnetShroom",
width: 102,
beAttackedPointR: 98,
height: 90,
target: -1,
SunNum: 100,
BookHandBack: 2,
SleepGif: 3,
cd: 15,
cotcd: 1000,
night: true,
Tooltip: "可以用磁力吸取僵尸的头盔",
Produce: '磁力菇可以用磁力吸取僵尸的头盔等其它金属物品。<p>范围:<font color="#FF0000">靠近的僵尸</font><br>特点:<font color="#FF0000">移除僵尸们所有的金属物品<br>白天睡觉</font></p>磁力是一种强大的力量,非常强大,强大到有时都吓到磁力菇自己了。能力越大,责任越大,他不知道自己能否肩负得起这责任。',
InitTrigger: function() {},
PicArr: [
"images/Card/Plants/MagnetShroom.png",
"images/Plants/Ms/Ms.gif",
"images/Plants/Ms/Ms.gif",
"images/Plants/Ms/sleep.gif",
],
getTriggerRange: (R, LX, RX) => [
[0, oS.W, 0]
],
AudioArr: ["blover"],
BirthStyle: function(c, d, b, a) {
oS.DKind &&
((c.canTrigger = 0),
(c.Sleep = 1),
(b.childNodes[1].src = c.PicArr[c.SleepGif]));
oSym.addTask(
1,
function(self) {
self.NormalAttack();
oSym.addTask(1, arguments.callee, [self]);
},
[c]
);
EditEle(
b, {
id: d,
},
a,
EDPZ
);
},
Die: function(a) {
var b = this,
c = b.id;
b.cd = 0;
ClearChild(b.imgnn);
b.target = "die";
b.oTrigger && oT.delP(b);
b.HP = 0;
delete $P[c];
delete oGd.$[b.R + "_" + b.C + "_" + b.PKind];
$P.length -= 1;
!a && ClearChild($(c));
b.PrivateDie(b);
},
getTriggerR: (selfR) => [
selfR - 2 < 1 ? 1 : selfR - 2,
selfR + 2 > oS.R ? oS.R : selfR + 2,
],
PrivateBirth: function() {},
Plength: function(pid, zid) {
//判断僵尸是否在磁力菇的攻击范围内
if (zid.Ifgc != 0 || zid.OrnHP == 0) return 0;
//alert(123);
if (
zid.EName != "oScreenDoorZombie" &&
zid.EName != "oDuckyTubeZombie4" &&
zid.EName != "oSmallFootballZombie" &&
zid.EName != "oFootballZombie" &&
zid.EName != "oDuckyTubeZombie3" &&
zid.EName != "oJackinTheBoxZombie" &&
zid.EName != "oBucketheadZombie" &&
zid.EName != "oDiggerZombie" &&
zid.EName != "oIScreenDoorZombie" &&
zid.EName != "oIDuckyTubeZombie4" &&
zid.EName != "oISmallFootballZombie" &&
zid.EName != "oIFootballZombie" &&
zid.EName != "oIDuckyTubeZombie3" &&
zid.EName != "oIJackinTheBoxZombie" &&
zid.EName != "oIBucketheadZombie" &&
zid.EName != "oIDiggerZombie"
)
return 0;
if (Math.abs(zid.R - pid.R) > 2) return 0;
if (Math.abs(zid.X - pid.pixelLeft) > 200) return 0;
return 1;
},
Plength1: function(pid, zid) {
//计算僵尸和磁力菇之间的距离
var chang = Math.abs(zid.R - pid.R) * 100;
var kuan = Math.abs(zid.X - GetX(pid.C));
return Math.sqrt(chang * chang + kuan * kuan);
},
AttackCheckZ: function() {
//查找僵尸
var self = this,
z,
otarget,
llen,
lastx;
var Target = -1;
for (z in $Z) {
otarget = $Z[z];
if (!self.Plength(self, otarget) || otarget.PZ == 0) continue;
if (Target == -1) {
Target = $Z[z];
continue;
}
llen = self.Plength1(self, otarget);
if (llen < self.Plength1(self, Target)) {
Target = otarget;
}
}
self.target = Target;
if (self.target == -1) return 0;
return 1;
},
Yesgif: function() {
try {
if (this.cd && $(this.id).childNodes[1].src != "images/Plants/Ms/Ms.gif")
$(this.id).childNodes[1].src = "images/Plants/Ms/Ms.gif";
} catch (arr) {}
},
attackzombiest: function(zid) {
if (zid.CName == "矿工僵尸") {
//alert(1);
zid.Stone_of_Sinan_Up();
} else {
zid.OrnHP = 0;
zid.getHit0(zid, 0, 0);
}
},
NormalAttack: function() {
//alert(this.canTrigger);
//alert(1);
if (this.AttackCheckZ() && this.cd) {
var self = this;
var id = self.id;
var zid = self.target;
if (zid.Ifgc == 1) return;
zid.Ifgc = 1;
$(id).childNodes[1].src =
"images/Plants/Ms/attack.gif" + "?" + Date.now() + Math.random();
oSym.addTask(
80,
function(zid, self) {
self.attackzombiest(zid);
},
[zid, self]
);
self.cd = 0;
oSym.addTask(
self.cotcd,
function(id) {
self.target = -1;
self.cd = 1;
self.Yesgif();
},
[id]
);
}
},
}))
Loading

0 comments on commit ec3b5b7

Please sign in to comment.