mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-24 13:40:13 -05:00
Added Golden Bot Spawn Mechanic
hopefully i did this right, couldnt get any help in the discord
This commit is contained in:
@@ -34,6 +34,7 @@ var stats = {
|
|||||||
var edges = {
|
var edges = {
|
||||||
next_goldenbat: 80000,
|
next_goldenbat: 80000,
|
||||||
next_cutebee: 480000,
|
next_cutebee: 480000,
|
||||||
|
next_goldenbot: 100000,
|
||||||
};
|
};
|
||||||
var NPC_prefix = "NPC0000000000000000NPC";
|
var NPC_prefix = "NPC0000000000000000NPC";
|
||||||
|
|
||||||
@@ -1805,6 +1806,20 @@ function spawn_special_monster(type) {
|
|||||||
new_monster(pack.i, pack);
|
new_monster(pack.i, pack);
|
||||||
// broadcast("game_event",{name:"goldenbat",map:pack.i});
|
// broadcast("game_event",{name:"goldenbat",map:pack.i});
|
||||||
}
|
}
|
||||||
|
if (type == "goldenbot") {
|
||||||
|
var packs = [];
|
||||||
|
["uhills"].forEach(function (m) {
|
||||||
|
G.maps[m].monsters.forEach(function (p) {
|
||||||
|
if (!p.boundaries && (p.type === "targetron" || p.type === "sparkbot")) {
|
||||||
|
packs.push({ type: "goldenbot", boundary: p.boundary, count: 1, i: m, roam: true });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
var pack = packs[floor(Math.random() * packs.length)];
|
||||||
|
pack.gold = D.monster_gold.goldenbot;
|
||||||
|
new_monster(pack.i, pack);
|
||||||
|
// broadcast("game_event",{name:"goldenbot",map:pack.i});
|
||||||
|
}
|
||||||
if (type == "cutebee") {
|
if (type == "cutebee") {
|
||||||
var packs = [];
|
var packs = [];
|
||||||
["main"].forEach(function (m) {
|
["main"].forEach(function (m) {
|
||||||
@@ -2072,6 +2087,11 @@ function event_loop() {
|
|||||||
spawn_special_monster("goldenbat");
|
spawn_special_monster("goldenbat");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (events.goldenbot && (stats.kills.targetron + stats.kills.sparkbot) > edges.next_goldenbot) {
|
||||||
|
edges.next_goldenbot += parseInt(events.goldenbot * Math.random());
|
||||||
|
spawn_special_monster("goldenbot");
|
||||||
|
}
|
||||||
|
|
||||||
if (events.cutebee && stats.kills.bee > edges.next_cutebee) {
|
if (events.cutebee && stats.kills.bee > edges.next_cutebee) {
|
||||||
edges.next_cutebee += parseInt(events.cutebee * Math.random());
|
edges.next_cutebee += parseInt(events.cutebee * Math.random());
|
||||||
spawn_special_monster("cutebee");
|
spawn_special_monster("cutebee");
|
||||||
|
|||||||
Reference in New Issue
Block a user