WAR¶
Overview¶
WAR is the game mechanics contract for territory warfare and resource generation. It manages H2O (water) token minting and CO2 accumulation based on player activities.
- Inherits: DYSNOMIA V2
- License: Sharia
- Solidity: ^0.8.21
What This Means For Players¶
Plain English Summary: WAR is the battle system - fight for territory and earn water (H2O). When you contest positions in the distribution queue, WAR calculates your power and rewards you with H2O tokens if you beat previous records. It's the competitive element of the game where actions lead to resource generation.
Real-World Analogy: Imagine a game show where contestants compete for prizes by setting high scores. WAR is like that scoreboard - when you beat a previous record at a position, you win water tokens as a reward. The game also tracks "pollution" (CO2) as a side effect of all this activity.
How It Affects Your Gameplay: - Earn H2O - Beat high scores at positions to receive water tokens - Territory power - Your Waat value determines your strength at each position - CO2 tracking - Global pollution accumulates from WAR activities - Strategy - Choose positions wisely to maximize your rewards
State Variables¶
| Variable | Type | Visibility | Description |
|---|---|---|---|
| Type | string | public constant | "WAR" |
| World | WORLDINTERFACE | public | Reference to WORLD contract |
| Water | H2O | public | Water token contract |
| CO2 | uint256 | public | Accumulated CO2 |
| _taan | mapping(address => mapping(uint256 => uint256)) | private | Carbon tracking |
Write Functions¶
Faa¶
- Access:public
- Parameters:
- Caude (address): Target token/QING address to contest
- Position (uint256): Position in the distribution queue (Lin value)
- Returns:
- Waat (uint256): Computed power value = modExp(Phoebe, Charge, Meridians[89]) - your territory strength
- Description: Calculates territory power for a position using RING.Eta values. If the new Waat exceeds the stored record, mints H2O rewards and accumulates CO2.
- Logic Flow:
1. Get existing value: Buzz = World.Tail(Caude, Position) - check distribution queue
2. If Buzz == 0, return 0 (no valid target)
3. Get player's YUE: (Chi, ) = World.Cheon().Sei().Chi()
4. Get ring parameters: (Phoebe, Iota, Chao, Charge) = World.Meta().Ring().Eta()
5. Compute Waat: modExp(Phoebe, Charge, World.Map().Map().Meridians(89))
6. If Waat > _taan[Caude][Position]:
- Mint H2O to player: Water.Mint(address(Chi), Iota)
- Accumulate pollution: CO2 += Chao
- Store new record: _taan[Caude][Position] = Waat
7. Return Waat
- Computation Details:
- Waat = Phoebe ^ Charge mod Meridians[89]
- Phoebe is the base reward value from PANG
- Charge is the adjusted power from RING.Eta
- Meridians[89] provides the modulus from HECKEMERIDIANS
- Only beats existing records get H2O rewards
- Side Effects: May mint H2O tokens to player's YUE; may increment global CO2; updates _taan mapping; triggers full RING.Eta chain including all soeng calculations
- In Plain English: Contest a position for a token to earn water (H2O) rewards. This calculates your power by running through the entire RING→PANG→soeng chain. If your computed Waat beats the previous record at that position, you win Iota amount of H2O tokens as a reward. The Chao value gets added to global CO2 pollution as a side effect of the activity.
Contract Interactions¶
Depends On¶
- DYSNOMIA V2 - Base functionality
- WORLD - World state
- META - Ring calculations
Creates¶
- H2O - Water token
Depended On By¶
- GWAT - Uses Faa for spawning
Special Mechanisms¶
Faa Calculation¶
function Faa(address Caude, uint256 Position) public returns (uint256 Waat) {
uint256 Buzz = World.Tail(Caude, Position);
if(Buzz == 0) return 0;
// Get player YUE
(YUEINTERFACE Chi, ) = World.Cheon().Sei().Chi();
// Get Ring parameters
(uint256 Phoebe, uint256 Iota, uint256 Chao, uint256 Charge) = World.Meta().Ring().Eta();
// Calculate Waat
Waat = Xiao.modExp(Phoebe, Charge, World.Map().Map().Meridians(89));
// If new high, mint rewards
if(Waat > _taan[Caude][Position]) {
Water.Mint(address(Chi), Iota);
CO2 += Chao;
}
}
Resource Generation¶
- H2O: Minted to player's YUE when Waat exceeds previous
- CO2: Accumulated globally as side effect
Constructor¶
constructor(address WorldAddress) {
World = WORLDINTERFACE(WorldAddress);
World.Cheon().Sei().Chan().addOwner(address(this));
Water = new H2O(address(this));
}
Contract Verification¶
| Property | Value |
|---|---|
| Keccak256 Hash | 0x55bf6112d383d200c30d129c9fa6a82c3713105e757a5a0ef3656cf4092a9738 |
| Source URL | https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/domain/dan/04_war.sol |
| Hash Generated | 2026-02-08T00:29:08Z |