Skip to content

Commit

Permalink
finish forge items
Browse files Browse the repository at this point in the history
lead ingot value
complete changelog
monster level is now computed from xp modifiers
  • Loading branch information
medsal15 committed Nov 2, 2024
1 parent e54926e commit ecc4aac
Show file tree
Hide file tree
Showing 8 changed files with 456 additions and 17 deletions.
12 changes: 10 additions & 2 deletions js/dummies/dummies.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,6 @@ declare class LayerData {
challenges?: { [id: number]: number }
}

//todo include shop value/cost
declare class Item<I> {
readonly id: I
color: Computable<string>
Expand Down Expand Up @@ -1537,7 +1536,7 @@ type items = 'unknown' |
'iron_ingot' | 'silver_ingot' | 'lead_ingot' | 'electrum_ingot' |
'stone_mace' | 'copper_pick' | 'tin_cache' | 'bronze_cart' | 'doubloon' |
'furnace' | 'iron_rails' | 'silver_coating' | 'electrum_coin_mold' | 'bellow' | 'lead_coating' |
'stone_wall' | 'copper_golem' | 'tin_ring' | 'bronze_mold' |
'stone_wall' | 'copper_golem' | 'tin_ring' | 'bronze_mold' | 'gold_star' | 'iron_heataxe' | 'disco_ball' | 'electrum_package' |
'coin_copper' | 'coin_bronze' | 'coin_silver' | 'coin_gold' | 'coin_platinum' |
'densium_slime' | 'densium_rock' | 'magic_densium_ball' |
'cueball';
Expand Down Expand Up @@ -1683,6 +1682,15 @@ type Layers = {
drops: {
mult(): Decimal
}
/**
* Monster level formula:
* `floor((kills / base) ^ exp * mult) + 1`
*/
level: {
base(): Decimal
mult(): Decimal
exp(): Decimal
}
}
}
m: Layer<'m'> & {
Expand Down
204 changes: 202 additions & 2 deletions js/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,6 @@ const item_list = {
unlocked() { return hasUpgrade('m', 61); },
},
// Forge
//todo values
'stone_brick': {
id: null,
color: '#BBBBDD',
Expand All @@ -1280,6 +1279,11 @@ const item_list = {
sources: {
other: ['forge',],
},
value: {
value() {
return D(50);
},
},
lore: `A brick of solid rock.<br>
Now this is some useful stone.<br>
Commonly used as a material for other things.`,
Expand All @@ -1296,6 +1300,11 @@ const item_list = {
sources: {
other: ['forge',],
},
value: {
value() {
return D(100);
},
},
lore: `A solid block of copper.<br>
Just as useful as copper, but easier to store.<br>
Proper storage allows slower color change.`,
Expand All @@ -1312,6 +1321,11 @@ const item_list = {
sources: {
other: ['forge',],
},
value: {
value() {
return D(900);
},
},
lore: `A light yellow ingot.<br>
The way you store these makes them look even prettier...`,
categories: ['materials', 'forge'],
Expand All @@ -1327,6 +1341,11 @@ const item_list = {
sources: {
other: ['forge',],
},
value: {
value() {
return D(400);
},
},
lore: `A big brown ingot.<br>
This is much easier to handle.<br>
Congratulations on actually reaching the bronze age!`,
Expand All @@ -1343,6 +1362,11 @@ const item_list = {
sources: {
other: ['forge',],
},
value: {
value() {
return D(5_000);
},
},
lore: `A small, but very rare ingot.<br>
Somehow, the more you own, the harder it is to find.<br>
Many people would kill for one of these.`,
Expand Down Expand Up @@ -1377,6 +1401,11 @@ const item_list = {
sources: {
other: ['forge',],
},
value: {
value() {
return D(400);
},
},
lore: `A gray block of metal.<br>
Keeps all the positives of iron, but is easier to store.<br>
Congratulations on reaching the iron age!`,
Expand All @@ -1393,6 +1422,11 @@ const item_list = {
sources: {
other: ['forge',],
},
value: {
value() {
return D(15_000);
},
},
lore: `An almost white metal block.<br>
Looks like you managed to separate the impurities.<br>
The way they are stored makes them shine almost too brightly`,
Expand All @@ -1409,6 +1443,11 @@ const item_list = {
sources: {
other: ['forge',],
},
value: {
value() {
return D(1_500);
},
},
lore: `A black metal cube.<br>
It feels very heavy.<br>
So that's what was mixed with the silver...`,
Expand All @@ -1425,6 +1464,11 @@ const item_list = {
sources: {
other: ['forge',],
},
value: {
value() {
return D(43_750);
},
},
lore: `A pretty light yellow alloy.<br>
The method of storage used makes them even prettier.<br>
Very valuable.`,
Expand Down Expand Up @@ -1894,7 +1938,6 @@ const item_list = {
},
unlocked() { return tmp.c.forge.unlocked; },
},
//todo value
'lead_coating': {
id: null,
color: '#113366',
Expand All @@ -1905,6 +1948,11 @@ const item_list = {
sources: {
other: ['crafting'],
},
value: {
value() {
return D(700);
},
},
lore: `Lead coating for a weapon.<br>
It's great for fighting living beings.<br>
It's also bad for fighting undeads.`,
Expand Down Expand Up @@ -2213,6 +2261,158 @@ const item_list = {
},
unlocked() { return tmp.c.forge.unlocked; },
},
'gold_star': {
id: null,
color: '#FFFF44',
name: 'gold star',
icon: [9, 4],
row: 1,
sources: {
other: ['forge',],
},
lore: `A fancy golden star.<br>
Its shine somehow lowers the levels of monsters.<br>
It's really, really pretty.`,
categories: ['equipment', 'forge'],
effect(amount) {
const x = D(amount ?? player.items[this.id].amount);

let level_delay = D(x),
cost_div = D.root(x, 2).pow_base(25);

return { level_delay, cost_div, };
},
effectDescription(amount) {
let level_delay, cost_div;
if (shiftDown) {
level_delay = '[amount]';
cost_div = '[25 ^ 2√(amount)]';
} else {
const x = D(amount ?? player.items[this.id].amount),
effect = item_list[this.id].effect(x);

level_delay = formatWhole(effect.level_delay);
cost_div = format(effect.cost_div);
}

return `Increases monster level delay by ${level_delay}, and divides gold ingot use costs by ${cost_div}`;
},
unlocked() { return tmp.c.forge.unlocked; },
},
'iron_heataxe': {
id: null,
color: '#8899AA',
name: 'iron heataxe',
icon: [9, 5],
row: 1,
sources: {
other: ['forge',],
},
lore: `A pickaxe that channels the heat of your forge.<br>
It's heavier than a normal pickaxe.<br>
You are wearing gloves, right?`,
categories: ['equipment', 'forge'],
effect(amount) {
const x = D(amount ?? player.items[this.id].amount);

let damage = D.add(player.c.heat, 1).log10().times(x),
cost_div = D.root(x, 4).pow_base(10);

return { damage, cost_div, };
},
effectDescription(amount) {
let damage, cost_div;
if (shiftDown) {
damage = '[log10(heat + 1) * amount]';
cost_div = '[10 ^ 4√(amount)]';
} else {
const x = D(amount ?? player.items[this.id].amount),
effect = item_list[this.id].effect(x);

damage = format(effect.damage);
cost_div = format(effect.cost_div);
}

return `Increases mining damage by ${damage}, and divides iron ingot use costs by ${cost_div}`;
},
unlocked() { return tmp.c.forge.unlocked; },
},
'disco_ball': {
id: null,
color: '#DDEEEE',
name: 'disco ball',
icon: [8, 6],
row: 1,
sources: {
other: ['forge',],
},
lore: `A shiny ball covered in small silver mirrors.<br>
The flashing lights hurt your eyes.<br>
Move to the rhythm!`,
categories: ['materials', 'forge'],
effect(amount) {
const x = D(amount ?? player.items[this.id].amount);

let speed = D.root(x, 2).div(10),
cost_div = D.root(x, 4).pow_base(25);

return { speed, cost_div, };
},
effectDescription(amount) {
let speed, cost_div;
if (shiftDown) {
speed = '[2√(amount) / 10]';
cost_div = '[25 ^ 4√(amount)]';
} else {
const x = D(amount ?? player.items[this.id].amount),
effect = item_list[this.id].effect(x);

speed = format(effect.speed);
cost_div = format(effect.cost_div);
}

return `Increases auto mining and attacking speed by ${speed}, and divides silver ingot use costs by ${cost_div}`;
},
unlocked() { return tmp.c.forge.unlocked; },
},
'electrum_package': {
id: null,
color: '#EEDDAA',
name: 'electrum package',
icon: [8, 7],
row: 1,
sources: {
other: ['forge',],
},
lore: `A light yellow box that helps in crafting.<br>
Its weight makes it clunky to use.<br>
Wait, why didn't you just make a box out of something easier to find?`,
categories: ['materials', 'forge'],
effect(amount) {
const x = D(amount ?? player.items[this.id].amount);

let limit = D.times(x, 10),
cost_div = D.root(x, 4).pow_base(20);

return { limit, cost_div, };
},
effectDescription(amount) {
let limit, cost_div;
if (shiftDown) {
limit = '[amount * 10]';
cost_div = '[20 ^ 4√(amount)]';
} else {
const x = D(amount ?? player.items[this.id].amount),
effect = item_list[this.id].effect(x);

limit = format(effect.limit);
cost_div = format(effect.cost_div);
}

return `Maximum crafting by ${limit}, and divides electrum ingot use costs by ${cost_div}`;
},
unlocked() { return tmp.c.forge.unlocked; },
},
// Shop
'coin_copper': {
id: null,
Expand Down
Loading

0 comments on commit ecc4aac

Please sign in to comment.