Skip to content

Commit

Permalink
unlock all tests in cw
Browse files Browse the repository at this point in the history
  • Loading branch information
ate47 committed Apr 20, 2024
1 parent b728dd4 commit a1c1c88
Show file tree
Hide file tree
Showing 3 changed files with 206 additions and 17 deletions.
4 changes: 2 additions & 2 deletions coldwar/scripts/core_common/dev/config.gsc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifdef ATIAN_MENU_DEV
function AtianMenuConfigDev() {
// zombies per round
self.zombies_per_rounds = 7;
self.zombies_per_rounds = 999999;

self.force_camo = 63;

Expand Down Expand Up @@ -32,6 +32,6 @@ function get_xp_multiplier_late() {
}

function get_xp_multiplier() {
return 99999;
return 1;
}
#endif
196 changes: 191 additions & 5 deletions coldwar/scripts/core_common/menu_funcs.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ function compute_weapon_xp() {
}

for (row = 0; row < rows; row++) {
xp = tablelookupcolumnforrow(tablename, row, 2);
name = tablelookupcolumnforrow(tablename, row, 3);
xp = tablelookupcolumnforrow(tablename, row, 1);
name = tablelookupcolumnforrow(tablename, row, 2);

wp = getweapon(name);

Expand Down Expand Up @@ -375,8 +375,11 @@ function func_unlock_all_weapon(item) {

foreach (grpname, wps in levels) {
self menu_drawing_secondary("grpname: " + grpname + ", wps: " + wps.size);
foreach (weapon, xplvl in wps) {
w = getweapon(weapon);
foreach (w, xplvl in wps) {
if (!isdefined(w.name)) {
continue;
}
weapon = w.name;
self menu_drawing_secondary("work: " + weapon);

if (!isdefined(w)) {
Expand Down Expand Up @@ -472,7 +475,7 @@ function func_unlock_all(item) {
group = tablelookupcolumnforrow(tablename, row, 3);
name = tablelookupcolumnforrow(tablename, row, 4);

self menu_drawing_function(lookup_group_name(group) + "/" + name);
self menu_drawing_function(lookup_group_name(group) + "/" + name + " (" + (row + 1) + "/" + rows + ")");

switch (group) {
case #"global":
Expand Down Expand Up @@ -504,6 +507,189 @@ function func_unlock_all(item) {
uploadstats(self);
}
}
self menu_drawing_secondary("Done");
#endif
}

function get_weapon_max_xp(weapon) {
if (sessionmodeiszombiesgame()) {
prefix = "zm";
} else if (sessionmodeismultiplayergame()) {
prefix = "mp";
} else {
return 0;
}

tablename = #"gamedata/weapons/" + prefix + "/" + prefix + "_gunlevels.csv";

rows = tablelookuprowcount(tablename);
columns = tablelookupcolumncount(tablename);

if (!isdefined(rows) || !isdefined(columns) || rows * columns == 0) {
return 0;
}

max = 0;

for (row = 0; row < rows; row++) {
xp = tablelookupcolumnforrow(tablename, row, 1);
name = tablelookupcolumnforrow(tablename, row, 2);

if (name !== weapon || !isint(xp)) {
continue;
}

if (xp > max) {
max = xp;
}
}
return max;
}
function func_give_bonus(item) {
#ifdef ATIAN_MENU_DEV
self stats::set_stat(#"hash_65febbdf3f1ab4d7", #"rare", 198);
self stats::set_stat(#"hash_65febbdf3f1ab4d7", #"epic", 132);
self stats::set_stat(#"hash_65febbdf3f1ab4d7", #"legendary", 165);

self stats::set_stat(#"hash_51b649399e73640c", #"rare", 198);
self stats::set_stat(#"hash_51b649399e73640c", #"epic", 132);
self stats::set_stat(#"hash_51b649399e73640c", #"legendary", 165);

self menu_drawing_secondary("Done");
#endif
}

function func_test_giveall_weapon(item) {
#ifdef ATIAN_MENU_DEV
weapons = array(
#"ar_accurate_t9",
#"ar_british_t9",
#"ar_damage_t9",
#"ar_fastfire_t9",
#"ar_fasthandling_t9",
#"ar_mobility_t9",
#"ar_season6_t9",
#"ar_slowfire_t9",
#"ar_slowhandling_t9",
#"ar_standard_t9",
#"knife_loadout",
#"launcher_freefire_t9",
#"launcher_standard_t9",
#"lmg_accurate_t9",
#"lmg_fastfire_t9",
#"lmg_light_t9",
#"lmg_slowfire_t9",
#"melee_baseballbat_t9",
#"melee_battleaxe_t9",
#"melee_cane_t9",
#"melee_coldwar_t9_dw",
#"melee_etool_t9",
#"melee_mace_t9",
#"melee_machete_t9",
#"melee_sai_t9_dw",
#"melee_sledgehammer_t9",
#"melee_wakizashi_t9",
#"pistol_burst_t9",
#"pistol_fullauto_t9",
#"pistol_revolver_t9",
#"pistol_semiauto_t9",
#"pistol_shotgun_t9",
#"shotgun_fullauto_t9",
#"shotgun_leveraction_t9",
#"shotgun_pump_t9",
#"shotgun_semiauto_t9",
#"smg_accurate_t9",
#"smg_burst_t9",
#"smg_capacity_t9",
#"smg_fastfire_t9",
#"smg_handling_t9",
#"smg_heavy_t9",
#"smg_season6_t9",
#"smg_semiauto_t9",
#"smg_spray_t9",
#"smg_standard_t9",
#"sniper_accurate_t9",
#"sniper_cannon_t9",
#"sniper_powersemi_t9",
#"sniper_quickscope_t9",
#"sniper_standard_t9",
#"special_ballisticknife_t9_dw",
#"special_crossbow_t9",
#"special_grenadelauncher_t9",
#"special_nailgun_t9",
#"tr_damagesemi_t9",
#"tr_fastburst_t9",
#"tr_longburst_t9",
#"tr_powerburst_t9",
#"tr_precisionsemi_t9"
);

idx = 0;
foreach (w in weapons) {
curr = self getcurrentweapon();
if (isdefined(curr)) {
self takeweapon(curr);
}

weapon = getweapon(w);

idx++;
if (!isdefined(weapon)) {
continue;
}
self menu_drawing_function("weapon " + w + " (" + idx + "/" + weapons.size + ")");
self giveweapon(weapon);
self switchtoweapon(weapon);
wait 1;

tokill = 10;
// force max xp
while (tokill > 0) {
foreach (zombie in getaiteamarray(level.zombie_team)) {
if (isdefined(zombie)) {
zombie dodamage(zombie.maxhealth + 666, zombie.origin, self);
tokill--;
}
if (!tokill) {
break;
}
}
waitframe(1);
}
wait 0.2;

self addweaponstat(weapon, #"kills", 2500);
self addweaponstat(weapon, #"hash_46422decc5803401", 2500);
self addweaponstat(weapon, #"packedkills", 2500);
self addweaponstat(weapon, #"hash_9c59d60380f570a", 15);
self addweaponstat(weapon, #"multikill", 10);
self addweaponstat(weapon, #"hash_5870df5ed04a8f11", 25);
self addweaponstat(weapon, #"hash_1f3b0d3bd9acb4a5", 10);

self addweaponstat(weapon, #"rapidkills", 50);
self addweaponstat(weapon, #"hash_72467b6043fb9ef7", 50);
self addweaponstat(weapon, #"hash_1f451bc4d664e2ad", 50);
self addweaponstat(weapon, #"hash_16ef903a11cc4173", 15);
self addweaponstat(weapon, #"ekia", 5000);
self addweaponstat(weapon, #"hash_14b7133a39a0456e", 5000);
self addweaponstat(weapon, #"hash_49b586d05aaa0209", 2500);
stats::set_stat(#"item_stats", weapon.name, #"challenges", #"challengevalue", 35);

//self addweaponstat(weapon, #"challenges", 35);
//self addweaponstat(weapon, #"hash_7fce4a14fec05da1", 1);
//self addweaponstat(weapon, #"hash_404a29a3ead5edb3", 1);
//self addweaponstat(weapon, #"hash_141b0e8dbfaf9468", 1);
//self addweaponstat(weapon, #"hash_7f0ce2a2e0a76e67", 2);
//self addweaponstat(weapon, #"hash_5a2ba340560103b3", 1);
//self addweaponstat(weapon, #"hash_4711f96a09147c", 9);
//self addweaponstat(weapon, #"hash_4714f96a091995", 7);
//self addweaponstat(weapon, #"hash_4713f96a0917e2", 5);
//self addweaponstat(weapon, #"hash_440a913b1fa5afba", 3);
wait 0.01;
}

stats::set_stat(#"globalchallenges", #"weapons_mastery", #"challengetier", 9);
self menu_drawing_secondary("Done");
#endif
}

Expand Down
23 changes: 13 additions & 10 deletions coldwar/scripts/core_common/menu_items.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -374,18 +374,21 @@ function init_menus() {
self add_menu_item("map", "Forsaken", &func_set_map, "zm_tungsten");
}

if (is_dev_mode()) {
self add_menu("dev", "Dev", "start_menu", true);
self add_menu_item("dev", "test dev 1", &func_dev_1);
self add_menu_item("dev", "test varargs", &func_testvarargs);
self add_menu_item("dev", "test unlock all", &func_unlock_all);
self add_menu_item("dev", "weapon unlock all", &func_unlock_all_weapon);
#ifdef ATIAN_MENU_DEV
self add_menu("unlockall", "Unlock", "start_menu", true);
self add_menu_item("unlockall", "Unlock all stats", &func_unlock_all);
self add_menu_item("unlockall", "Weapon give camos", &func_test_giveall_weapon);
self add_menu_item("unlockall", "Give max bonus", &func_give_bonus);

self add_menu("dev", "Dev", "start_menu", true);
self add_menu_item("dev", "test dev 1", &func_dev_1);
self add_menu_item("dev", "test varargs", &func_testvarargs);
//self add_menu_item("dev", "weapon unlock all", &func_unlock_all_weapon);

self add_menu_item("dev", "test weapon 1", &func_dev_weap_1);
self add_menu_item("dev", "test weapon 2", &func_dev_weap_2);
self add_menu_item("dev", "test ee", &func_test_ee);
}
self add_menu_item("dev", "test weapon 1", &func_dev_weap_1);
self add_menu_item("dev", "test weapon 2", &func_dev_weap_2);
self add_menu_item("dev", "test ee", &func_test_ee);
#endif
}

function func_test_ee(item) {
Expand Down

0 comments on commit a1c1c88

Please sign in to comment.