Add Claiming and Economy pages with routing and styles

Created new Claiming and Economy components, templates, styles, and tests. Integrated both pages into the app's routing, enabling navigation and functionality. Updated home page layout and added necessary utility styles.
This commit is contained in:
Peter 2025-04-18 22:52:05 +02:00
parent 235f4fb60f
commit 680506997e
12 changed files with 424 additions and 6 deletions

View File

@ -4,8 +4,4 @@
# New page
- ng generate component <name>
- Go to the component (<name>.component.ts)
- add standalone: false to the @Component
- remove imports: [] from that same block
- Go to app.module.ts and add the new page in declaration
- Add the new file to routes and give it a path (like 'new_page')
- Go to app.routes.ts and give it a path

View File

@ -44,6 +44,14 @@ export const routes: Routes = [
{
path: 'bans',
loadComponent: () => import('./bans/bans.component').then(m => m.BansComponent)
},
{
path: 'economy',
loadComponent: () => import('./economy/economy.component').then(m => m.EconomyComponent)
},
{
path: 'claiming',
loadComponent: () => import('./claiming/claiming.component').then(m => m.ClaimingComponent)
}
];

View File

@ -0,0 +1,176 @@
<ng-container>
<app-header [current_page]="'claiming'" height="460px" background_image="/public/img/backgrounds/trees.jpg"
[overlay_gradient]="0.5">
<div class="title" header-content>
<h1>Claiming</h1>
<h2>Claiming allows you to protect your items and builds from other players.</h2>
</div>
</app-header>
<main>
<section class="darkmodeSection">
<section class="columnSection">
<div class="columnContainer">
<div class="columnParagraph">
<h2>Getting Started</h2>
<p>You can “claim” land on Altitude to protect your builds. When you claim a section of land, other players
will be unable to place or break blocks, kill animals, take crops, or open chests. Everything will be
completely protected!</p>
<p>To claim land, you will need some basic tools: a golden shovel, and a stick. You can craft these items
yourself or do <b>/claim</b> to receive them for free. The shovel is used for modifying claims and the
stick is used for viewing claim information.</p>
<img ngSrc="/public/img/items/shovel.png" alt="Minecraft golden shovel" style="width: 25%;" height="114"
width="114">
<p>Players start with an allowance of 500 “claim blocks” and can purchase additional “claim blocks” with
in-game currency using <span style="font-family: 'opensans-bold', sans-serif;">/buyclaimblocks</span>. How
many claims you can create depends on the rank you have - the amount can be found on the <a
[routerLink]="['/ranks']">ranks</a> page. Additionally, there is also a limit on how many blocks in
total you can
claim.</p>
</div>
<div class="columnParagraph">
<h2>Creating a Claim</h2>
<p>Before creating any claim, we should check if there are other claims by other players nearby. Claims by
different people should be at least 100 blocks apart unless both parties discuss otherwise. To do this,
hold a stick in your hand and <b>shift + right click</b> to visualize all nearby claims. Claims are
visualized using dotted lines of gold blocks, so look around for any dotted lines on the ground around
you.</p>
<p>Once you've confirmed that there are no claims too close, we can begin claiming! A claim doesn't go down
all the way. The lowest point of the claim starts at 5 blocks below the lower corner you made. It'll keep
expanding down as you place blocks lower and lower in the claim, but it may reset when you change the
claim size, trust, subclaims etc. If you want to make sure your claim stays extended all the way down,
make one of the initial corners at bedrock level. Remember to not claim further down than you need to.</p>
<p>If a claim is within 100 blocks you will be unable to create your claim. If the original claim owner is
fine with you having a claim closer than the 100 blocks, then they can trust you using <span
style="font-family: 'opensans-bold', sans-serif;">/claimnearbytrust</span>. You will need to be trusted
in order to claim and resize. The trust expires on every server reboot, this is to remind you that there
are nearby claims.</p>
</div>
<div class="columnParagraph">
<h2>Automatic Claim Deletion</h2>
<p>When a player has been inactive for 60 consecutive days, on a server (not cross-server), their claim(s)
on that server will be transferred into an admin claim(s). The claim will be in that state for 24 hours
after which is will be fully unclaimed. During the time the claim is an admin claim everyone will be
trusted. This means that you will be able to raid the claim, but not claim it. If you wish to claim the
build you will have to return 24 hours later.</p>
<p>If you are planning on being gone this long, all you need to do is join for a couple of minutes within
those 60 days to reset the timer. Unclaimed land is fair game to loot, so make sure your claims are active
and properly sized!</p>
<p>Any containers (i.e shulker, chest) that are placed within an active raid-claim are fair game - this also
includes containers that raiders place. This means that items a raider puts into their personal shulker
aren't safe while placed down or when on the ground as an item after being broken, as anyone that comes by
can take it.</p>
</div>
<div class="columnParagraph">
<h2>Useful Commands</h2>
<ul>
<li><span style="font-family: 'opensans-bold', sans-serif;">/buyclaimblocks -</span> Buy more claim
blocks
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/sellclaimblocks -</span> Sell claim blocks
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/unclaim -</span> Remove a protection</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/claimslist -</span> List all of your
protections
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/expandclaim &lt;number&gt; -</span> Expand
the claim the direction you're facing (can also be used with negative numbers to downsize the claim)
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/containertrust &lt;player&gt; -</span> Give
someone access to chests in your claim
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/permissiontrust &lt;player&gt; -</span> Give
someone the ability to trust and untrust others in your claim
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/accesstrust &lt;player&gt; -</span> Give
someone access to doors and trapdoors in your claim
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/subdivide -</span> Create claims within your
main claim that you can trust people to
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/restrictsubclaim -</span> Sets subclaim NOT
to inherit perms from the parent claim
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/trust &lt;player&gt; -</span> Allow someone
to build and use chests within your claim
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/trustlist -</span> See who is trusted in your
claim
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/untrust &lt;player&gt; -</span> Remove a
player from your protection
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/kickfromclaim &lt;player&gt; -</span> Kick a
player outside of your claim
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/petkick -</span> Enter pet kicking mode
(right click pets you don't want in your claim)
</li>
</ul>
</div>
</div>
<div class="columnContainer">
<div class="columnParagraph">
<h2>Resizing Your Claim</h2>
<p>You can make your claim bigger or smaller any time by using a golden shovel. The process is similar to
creating the claim. To make things easier, start by right clicking within the claim with a stick. This
will show the border of the claim so you can see where the corners are.</p>
<p>To resize a claim, right click a corner you would like to move. Then, right click again wherever you
would like to move that corner to. To make things easier, you don't need to right click the actual block,
you can just point your crosshair at the block and right click from a distance.</p>
<p>If you don't have the needed amount of claim blocks to expand (or create) your claim, you will need to
purchase additional claim blocks. The price for purchasing claim blocks is different depending on how many
you have:</p>
<ul>
<li>0-10,000 blocks = $0.50/block</li>
<li>10,000-50,000 blocks = $0.75/block</li>
<li>50,000-300,000 blocks = $1.00/block</li>
<li>300,000-1,000,000 blocks = $2.00/block</li>
<li>1,000,000+ blocks = $5.00/block</li>
</ul>
<p>If you have left over claim blocks you can sell them using <span
style="font-family: 'opensans-bold', sans-serif;">/sellclaimblocks</span>. The return will always be
$0.50/block. This means that you need to be mindful of purchasing large amounts of claim blocks; don't
purchase them unless you actually need them.</p>
<img ngSrc="/public/img/backgrounds/claim.png" alt="Screenshot showing claim border in-game"
style="width: 100%;"
width="480" height="250">
</div>
<div class="columnParagraph">
<h2>Subdividing Claims</h2>
<p>Subdividing claims allows you to give players access to specific parts of your claim. This is the best
way to manage a town or shop!</p>
<p>The idea behind subdivisions is easy. You are creating mini-claims within your main claim so that you can
trust people to certain areas, but not the entire claim. You are still in control of the border of these
mini-claims (size and location). Once a subdivision is created you can trust people the same way as
before. Just stand in the mini-claim and use the trust commands. It will only trust them to the
mini-claim. (To trust someone to your main claim you will need to stand outside of any mini-claims you've
created.)</p>
<p>To create a subdivision you need to go into "subdivision mode". You can access this mode with <b>/subdivideclaims</b>.
Once you are in this mode you can create the subdivisions the same way you would make a regular claim,
just right click two corners. Subdivisions will be outlined with a white dotted line. To leave subdivision
mode use <b>/basicclaims</b>.</p>
<img ngSrc="/public/img/backgrounds/townsubdivisions.png" alt="Screenshot of town subdivided"
style="width: 100%;"
width="480" height="250">
</div>
<div class="columnParagraph">
<h2>Trusting Others</h2>
<p>You can add other players to your protected area with various levels of access. To trust everyone on the
server replace &lt;player&gt; with "all". This works with all of the commands below.</p>
<ul>
<li>To give someone full access to your claim (break, build, access chests, etc) do: <b>/trust &lt;player&gt;</b>
</li>
<li>To give someone just the ability to access storage items, but NOT build, do: <b>/containertrust &lt;player&gt;</b>
</li>
<li>To give someone visitor access (opening the doors, but not take anything or build anything) do: <b>/accesstrust
&lt;player&gt;</b></li>
<li>To give someone permission to manage your claim (trusting other players) do: <b>/permissiontrust &lt;player&gt;</b>
</li>
</ul>
</div>
</div>
</section>
</section>
</main>
</ng-container>

View File

@ -0,0 +1,9 @@
main ul {
font-family: opensans, sans-serif;
text-align: left;
}
main li {
margin-left: 30px;
padding-bottom: 10px;
}

View File

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ClaimingComponent } from './claiming.component';
describe('ClaimingComponent', () => {
let component: ClaimingComponent;
let fixture: ComponentFixture<ClaimingComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ClaimingComponent]
})
.compileComponents();
fixture = TestBed.createComponent(ClaimingComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,18 @@
import {Component} from '@angular/core';
import {HeaderComponent} from '../header/header.component';
import {NgOptimizedImage} from '@angular/common';
import {RouterLink} from '@angular/router';
@Component({
selector: 'app-claiming',
imports: [
HeaderComponent,
NgOptimizedImage,
RouterLink
],
templateUrl: './claiming.component.html',
styleUrl: './claiming.component.scss'
})
export class ClaimingComponent {
}

View File

@ -0,0 +1,135 @@
<ng-container>
<app-header [current_page]="'economy'" height="460px" background_image="/public/img/backgrounds/trees.jpg"
[overlay_gradient]="0.5">
<div class="title" header-content>
<h1>Economy</h1>
<h2>Altitude features a dynamic in-game economy that uses virtual currency to allow for easier trading between
players.</h2>
</div>
</app-header>
<main>
<section class="darkmodeSection">
<section class="columnSection">
<div class="columnContainer">
<div class="columnParagraph">
<h2>What is the Economy?</h2>
<p>Altitude uses a combination of simple player shops and dynamic NPC merchants to create a truly
one-of-a-kind experience for our players. Shops and Merchants allow you to exchange items for virtual
currency, and vice-versa. The spawn of each server has some items that can be bought or sold by talking to
the various merchants, but player shops are the backbone of the system. These shops are created and run by
our players, and they allow those players to determine and set their own prices for their goods.</p>
<p>The virtual currency on Altitude has no value outside of the server, nor any item in-game representing
it. Each player has a number representing how much in-game currency they have. You can check this any time
with <span style="font-family: 'opensans-bold', sans-serif;">/bal</span>.</p>
</div>
<div class="columnParagraph">
<h2>Player Shops</h2>
<p>Altitude allows players to create chest shops, which other players can either buy or sell items to. Its
a really simple task to create your shops. Theres no complex commands or multi-line sign setups -
everything is done using a GUI.</p>
<p>To get started, grab a sign and place it on a container (does not work on double chests). Write [shop] on
the first line and youre ready to go. Exit the sign interface and the GUI will open. With these simple
steps you will have successfully created your first shop!
Right click the sign to manage the shop. From there you can control the shop balance, item, item amount
and price.</p>
</div>
<div class="columnParagraph">
<h2>Shop Balance</h2>
<p>Every shop will have its own balance. The balance is used to for making changes in the shop management
GUI, paying players if they sell items to the shop and receiving money when players buy items from the
shop.</p>
</div>
<!-- <div class="columnparagraph">
<h2>Shop Upkeep</h2>
<p>Once a week shop upkeep need to be paid. The amount depends on the amount of shops you have; the higher the amount of shops, the higher the fee.
The fee will be taken from the shops balance. Should there not be enough money in the balance to pay the upkeep fee the shop will be deactivated. Once it had been deactivated other players will no longer be able to interact with it until the shop owner has reactivated it.</p>
<p>A shop that hasnt been interacted with (players using the shop) for three weeks, even if it has the balance to pay for upkeep, will be deactivated and will also need to be reactivated. This is done to prevent dormant and forgotten shops.</p>
</div> -->
<div class="columnParagraph">
<h2>Economist's Tips</h2>
<p>To get the most of the in-game economy, keep these tips in mind!</p>
<ul>
<li>Use the spawn merchants to buy and sell as a last resort! These merchants have intentionally worse
prices to allow for player markets to emerge for those same items.
</li>
<li>Build multiple, smaller farms for different types of items to sell rather than one massive farm that
only generates one type of item. Youll earn more money because of the dynamic prices!
</li>
<li>Keep track of the points you have with each merchant! Knowing how many points you have will allow you
to time your buying and selling for the biggest potential profit!
</li>
<li>Remember that player shops have flat prices, while the spawn merchants have dynamic prices.</li>
<li>Try not to buy or sell when your points are at the worst levels! You will get a huge penalty for
having such an extreme amount of points and the transaction will likely not be worth it.
</li>
</ul>
</div>
</div>
<div class="columnContainer">
<div class="columnParagraph">
<h2>Spawn Merchants</h2>
<p>Every merchant at spawn buys and sells certain types of items. You can interact and trade with them
similar to how you would trade emeralds with a regular villager. Each of these merchants are located
around each of the server spawn, which you can conveniently get to by doing <span
style="font-family: 'opensans-bold', sans-serif;">/spawn</span>!</p>
<!-- INSERT IMAGE OF VILLAGER MERCHANT -->
<p>These merchants buy and sell directly from the server, not from other players. Prices from these
merchants are typically quite high for buying, and quite low for selling. This means that they should be
used as a last resort for some quick cash or some quick materials; player shops will generally be a much
better value, especially because the prices are static.</p>
</div>
<div class="columnParagraph">
<h2>The Point System</h2>
<p>The prices offered by the merchants at spawn are dynamic in nature. This means that they change based on
the amount and type of items that you've bought or sold recently. Every merchant at spawn keeps track of
how many items youve traded with it using points. The amount of points you currently have with each
merchant is shown in the trading screen. To understand the point system, all you need to know is:</p>
<ul>
<li>Positive points = higher buy prices, higher sell prices</li>
<li>Negative points = lower buy prices, lower sell prices</li>
<li>Points decay naturally over time. The decay is faster if you are online</li>
</ul>
<p>For most players, this dynamic point system wont affect you much at all. As long as you arent buying or
selling huge quantities of items, you wont notice a large change in the prices as you use the spawn
merchants.</p>
<p>However, players can take advantage of the point system to make the most amount of profit possible if
they are so inclined. To do this, you need to understand the multipliers that affect prices at different
price levels. You can see your current price multipliers and points at each merchant by doing <span
style="font-family: 'opensans-bold', sans-serif;">/villagerui points</span>.</p>
<p style="padding-bottom: 0;">There are different thresholds for each price multiplier to take effect.
Between -500 and 500 points, prices will be unaltered. Once your points go above or below that range,
prices will become more and more extreme. You can see where these thresholds are based on your current
points here:</p>
<img ngSrc="/public/img/random/pointbracket.png" alt="Visualization of the point bracket."
style="width: 100%; padding: 0 0 15px 0;"
height="100" width="800">
</div>
<div class="columnParagraph">
<h2>Useful Commands</h2>
<ul>
<li><span style="font-family: 'opensans-bold', sans-serif;">/bal -</span> Check your current balance</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/pay &lt;player&gt; &lt;amount&gt; -</span>
Pay other players
</li>
<li><span style="font-family: 'opensans-bold', sans-serif;">/shop -</span> Click on settings, from there
you can change notification settings
</li>
<li><span
style="font-family: 'opensans-bold', sans-serif;">/villagerui points &lt;villagerType&gt; -</span>
Allows you to check your current points with each spawn merchant, or any specific one. Also shows your
current buy/sell price multipliers for those merchants
</li>
<li><span
style="font-family: 'opensans-bold', sans-serif;">/villagerui buy/sell &lt;item_name&gt; -</span> Tells
you if a spawn merchant buys or sells that item, and where that merchant is located
</li>
</ul>
</div>
</div>
</section>
</section>
</main>
</ng-container>

View File

@ -0,0 +1,9 @@
main ul {
font-family: opensans, sans-serif;
text-align: left;
}
main li {
margin-left: 30px;
padding-bottom: 10px;
}

View File

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { EconomyComponent } from './economy.component';
describe('EconomyComponent', () => {
let component: EconomyComponent;
let fixture: ComponentFixture<EconomyComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [EconomyComponent]
})
.compileComponents();
fixture = TestBed.createComponent(EconomyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,16 @@
import {Component} from '@angular/core';
import {HeaderComponent} from '../header/header.component';
import {NgOptimizedImage} from '@angular/common';
@Component({
selector: 'app-economy',
imports: [
HeaderComponent,
NgOptimizedImage
],
templateUrl: './economy.component.html',
styleUrl: './economy.component.scss'
})
export class EconomyComponent {
}

View File

@ -48,7 +48,7 @@
</section>
-->
<section class="darkmodeSection">
<div class="container" style="padding: 30px 0">
<div class="container" style="padding: 10px 0 80px 0">
<iframe id="discord-widget" src="https://discordapp.com/widget?id=141644560005595136&theme=dark"></iframe>
<div class="paragraph" id="discordp">
<h2>Meet the Community</h2>

View File

@ -292,6 +292,11 @@ main .container {
margin: 0 auto;
}
.columnParagraph > ul {
color: var(--font-color);
transition: 0.5s ease;
}
// Call to Action button
.button-outer {
display: inline-block;