mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-14 18:39:27 -05:00
Patron's Grace buff system prep
This commit is contained in:
@@ -1389,6 +1389,7 @@ def stop_character_api(**args):
|
|||||||
|
|
||||||
def sync_character_api(**args):
|
def sync_character_api(**args):
|
||||||
self,domain,user,server,id,data,user_data,unmount=gdmuld(args,"self","domain","user","server","character","data","user_data","unmount"); retries=3
|
self,domain,user,server,id,data,user_data,unmount=gdmuld(args,"self","domain","user","server","character","data","user_data","unmount"); retries=3
|
||||||
|
#logging.info(data.keys())
|
||||||
if unmount:
|
if unmount:
|
||||||
logging.info("Unmount mode")
|
logging.info("Unmount mode")
|
||||||
retries=16
|
retries=16
|
||||||
|
|||||||
@@ -117,12 +117,12 @@ if is_production:
|
|||||||
game_version=822
|
game_version=822
|
||||||
SALES=4+5+388+5101+125/20 #donation+manual+macos+steam+sales
|
SALES=4+5+388+5101+125/20 #donation+manual+macos+steam+sales
|
||||||
update_notes=[
|
update_notes=[
|
||||||
"Last Update [June 8th]",
|
"Last Update [August 7th]",
|
||||||
"Monsters with the stationary flag no longer move",
|
"PR: Fix display of Orb of Adventures #183",
|
||||||
"added the npcs's to the bank_u floor #177",
|
"PR: Fix Sanguine Amulet #185",
|
||||||
"Resist orbs #178",
|
"PR: Fix display of Frozen to correctly show speed reduction, fix value in G.conditions.poisoned to reflect actual frequency multiplier #188",
|
||||||
"moved gpurplepro spawn area #180",
|
"PR: Explanations for all conditions #189",
|
||||||
"make xmage stages humanoid #182",
|
"PR: Stop orbs from spamming game events #190",
|
||||||
]
|
]
|
||||||
ip_to_subdomain={ #IMPORTANT: SPECIAL PAGE RULES ARE NEEDED: https://dash.cloudflare.com/b6f5a13bded5fdd273e4a1cd3777162d/adventure.land/page-rules - uss1 / eus1 was best
|
ip_to_subdomain={ #IMPORTANT: SPECIAL PAGE RULES ARE NEEDED: https://dash.cloudflare.com/b6f5a13bded5fdd273e4a1cd3777162d/adventure.land/page-rules - uss1 / eus1 was best
|
||||||
"35.187.255.184":"asia1",
|
"35.187.255.184":"asia1",
|
||||||
|
|||||||
@@ -269,6 +269,18 @@ conditions={
|
|||||||
"ui":True,
|
"ui":True,
|
||||||
"persistent":True,
|
"persistent":True,
|
||||||
},
|
},
|
||||||
|
"patronsgrace":{
|
||||||
|
"skin":"patronsgrace",
|
||||||
|
"name":"Patron's Grace",
|
||||||
|
"explanation":"This server has been graced by a patron's support!",
|
||||||
|
"luck":5,
|
||||||
|
"gold":5,
|
||||||
|
"xp":20,
|
||||||
|
"speed":1,
|
||||||
|
"duration":60*60*1000,
|
||||||
|
"buff":True,
|
||||||
|
"ui":True,
|
||||||
|
},
|
||||||
"notverified":{
|
"notverified":{
|
||||||
"skin":"notverified",
|
"skin":"notverified",
|
||||||
"name":"Not Verified",
|
"name":"Not Verified",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1330,6 +1330,10 @@ function init_socket(args)
|
|||||||
$(".saferespawn").show();
|
$(".saferespawn").show();
|
||||||
}
|
}
|
||||||
else add_log("Note: Game dynamics and drops aren't final, they are evolving with every update","gray");
|
else add_log("Note: Game dynamics and drops aren't final, they are evolving with every update","gray");
|
||||||
|
if(data.blessed_by)
|
||||||
|
{
|
||||||
|
add_log("This server has been blessed by "+data.blessed_by,"#8F70D8");
|
||||||
|
}
|
||||||
// add_log("Warning: A Chrome bug is causing memory leaks, very small but it adds up. They patched the bug, however, that patch didn't make it to our browsers yet","#E08583");
|
// add_log("Warning: A Chrome bug is causing memory leaks, very small but it adds up. They patched the bug, however, that patch didn't make it to our browsers yet","#E08583");
|
||||||
$(".charactername").html(character.name);
|
$(".charactername").html(character.name);
|
||||||
page.title=character.name;
|
page.title=character.name;
|
||||||
|
|||||||
+53
-2
@@ -578,6 +578,7 @@ function player_to_server(player, place) {
|
|||||||
"width",
|
"width",
|
||||||
"height",
|
"height",
|
||||||
"u",
|
"u",
|
||||||
|
"user",
|
||||||
])
|
])
|
||||||
) {
|
) {
|
||||||
char[prop] = player[prop];
|
char[prop] = player[prop];
|
||||||
@@ -6998,6 +6999,37 @@ function init_io() {
|
|||||||
);
|
);
|
||||||
success_response({ success: false, in_progress: true });
|
success_response({ success: false, in_progress: true });
|
||||||
});
|
});
|
||||||
|
socket.on("bless_server", function (data) {
|
||||||
|
var player = players[socket.id];
|
||||||
|
if (!player || player.user || gameplay == "hardcore" || gameplay == "test") {
|
||||||
|
return fail_response("cant_in_bank");
|
||||||
|
}
|
||||||
|
var cost = 1200;
|
||||||
|
if (player.blessing) return fail_response("in_progress");
|
||||||
|
player.blessing = true;
|
||||||
|
appengine_call(
|
||||||
|
"bill_user",
|
||||||
|
{ auth: player.auth, amount: cost, reason: "blessing", name: player.name },
|
||||||
|
function (result) {
|
||||||
|
player.blessing = false;
|
||||||
|
server_log("buy_with_cash: " + JSON.stringify(result));
|
||||||
|
if (result.failed || !result.done) {
|
||||||
|
socket.emit("game_log", "Purchase failed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
player.cash = result.cash;
|
||||||
|
|
||||||
|
S.blessed_minutes = 60 * 24 * 7;
|
||||||
|
S.blessed_by = player.name;
|
||||||
|
|
||||||
|
socket.emit("game_log", "Spent " + to_pretty_num(cost) + " shells");
|
||||||
|
|
||||||
|
resend(player, "reopen+nc+inv");
|
||||||
|
bless_loop();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
success_response({ success: false, in_progress: true });
|
||||||
|
});
|
||||||
socket.on("sbuy", function (data) {
|
socket.on("sbuy", function (data) {
|
||||||
var player = players[socket.id];
|
var player = players[socket.id];
|
||||||
var done = false;
|
var done = false;
|
||||||
@@ -9833,6 +9865,11 @@ function init_io() {
|
|||||||
cdata.base_gold = D.base_gold;
|
cdata.base_gold = D.base_gold;
|
||||||
broadcast_e(true);
|
broadcast_e(true);
|
||||||
cdata.s_info = E;
|
cdata.s_info = E;
|
||||||
|
if (S.blessed_minutes) {
|
||||||
|
cdata.blessed_by = S.blessed_by;
|
||||||
|
cdata.blessed_minutes = S.blessed_minutes;
|
||||||
|
player.s.patronsgrace = { ms: G.conditions.patronsgrace.duration, f: S.blessed_by };
|
||||||
|
}
|
||||||
if (result.code) {
|
if (result.code) {
|
||||||
cdata.code = result.code;
|
cdata.code = result.code;
|
||||||
cdata.code_slot = result.code_slot;
|
cdata.code_slot = result.code_slot;
|
||||||
@@ -12425,7 +12462,7 @@ function update_instance(instance) {
|
|||||||
response: "compound_success",
|
response: "compound_success",
|
||||||
stale: ref.stale,
|
stale: ref.stale,
|
||||||
level: item.level,
|
level: item.level,
|
||||||
num: data.num,
|
num: ref.num,
|
||||||
up: item.extra || undefined,
|
up: item.extra || undefined,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
@@ -12449,7 +12486,7 @@ function update_instance(instance) {
|
|||||||
var def = G.items[item.name];
|
var def = G.items[item.name];
|
||||||
player.hitchhikers.push([
|
player.hitchhikers.push([
|
||||||
"game_response",
|
"game_response",
|
||||||
{ response: "compound_fail", level: item.level, num: data.num, stale: ref.stale },
|
{ response: "compound_fail", level: item.level, num: ref.num, stale: ref.stale },
|
||||||
]);
|
]);
|
||||||
if (calculate_item_value(item) + (def.edge || 0) * 2000000 > 920000 && !player.stealth) {
|
if (calculate_item_value(item) + (def.edge || 0) * 2000000 > 920000 && !player.stealth) {
|
||||||
broadcast("server_message", {
|
broadcast("server_message", {
|
||||||
@@ -13042,6 +13079,20 @@ function npc_loop() {
|
|||||||
setTimeout(npc_loop, max(28, min(1000, ms_since * 2 + 2))); // originally 24
|
setTimeout(npc_loop, max(28, min(1000, ms_since * 2 + 2))); // originally 24
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function bless_loop() {
|
||||||
|
if (S.blessed_minutes) S.blessed_minutes--;
|
||||||
|
if (!S.blessed_minutes) return;
|
||||||
|
for (var id in players) {
|
||||||
|
var player = players[id],
|
||||||
|
rs = false;
|
||||||
|
if (!player.s.patronsgrace) rs = true;
|
||||||
|
player.s.patronsgrace = { ms: G.conditions.patronsgrace.duration, f: S.blessed_by };
|
||||||
|
if (rs) resend(player, "u+cid");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setInterval(bless_loop, 60 * 1000);
|
||||||
|
|
||||||
function game_loop() {
|
function game_loop() {
|
||||||
// back in the day pretty much everything was in here [11/08/22]
|
// back in the day pretty much everything was in here [11/08/22]
|
||||||
if (!server.live) {
|
if (!server.live) {
|
||||||
|
|||||||
@@ -3191,7 +3191,8 @@ function xy_upush_logic(element) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function appengine_call(method, args, on_success, on_error) {
|
function appengine_call(method, args, on_success, on_error) {
|
||||||
var api_path = "/api/" + method;
|
var api_path = "/api/" + method,
|
||||||
|
suffix = "";
|
||||||
if (
|
if (
|
||||||
mode.prevent_external &&
|
mode.prevent_external &&
|
||||||
!in_arr(method, ["create_server", "update_server", "stop_server", "start_character", "send_mail"])
|
!in_arr(method, ["create_server", "update_server", "stop_server", "start_character", "send_mail"])
|
||||||
@@ -3222,14 +3223,17 @@ function appengine_call(method, args, on_success, on_error) {
|
|||||||
}
|
}
|
||||||
if (args.suffix) {
|
if (args.suffix) {
|
||||||
api_path += args.suffix;
|
api_path += args.suffix;
|
||||||
|
suffix = args.suffix;
|
||||||
delete args.suffix;
|
delete args.suffix;
|
||||||
}
|
}
|
||||||
data = {
|
var arguments = JSON.stringify(args);
|
||||||
|
var data = {
|
||||||
method: method,
|
method: method,
|
||||||
arguments: JSON.stringify(args),
|
arguments: arguments,
|
||||||
server_auth: server_id + "-" + server_auth,
|
server_auth: server_id + "-" + server_auth,
|
||||||
auth: args.auth,
|
auth: args.auth,
|
||||||
};
|
};
|
||||||
|
if (suffix.includes("unmount")) console.log(arguments.length);
|
||||||
try {
|
try {
|
||||||
request.post({ url: base_url + api_path, form: data }, function (err, response, body) {
|
request.post({ url: base_url + api_path, form: data }, function (err, response, body) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user