Skip to content

Instantly share code, notes, and snippets.

@forkiesassds
Last active December 29, 2022 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forkiesassds/fdae6a9c4cbf1f61628c986b477ef847 to your computer and use it in GitHub Desktop.
Save forkiesassds/fdae6a9c4cbf1f61628c986b477ef847 to your computer and use it in GitHub Desktop.

Tips

These tips are related with lava survival and show up when playing lava survival.

Tip: You start with 3 lives
Tip: If you survive to the end of lava flood you are the winner
Tip: In order to check how much money you have use /money command
Tip: When you loose all your lives you become a ghost
Tip: If you gather 500 score you level up
Tip: If at the end you are too close to the map spawn you don't get points!!
Tip: You can use water blocks, write: /water
Tip: The higher your level the more stuff you get each round /inv
Tip: Lava may sometimes destroy even solid blocks so look out!!
Tip: If you are above sea level at the end you get higher score
Tip: The more air around you at the end the higher the score!
Tip: One * gives you 10 percent higher score ** 20 percent and *** 30 percent more each next round
Tip: Ghosts can use /tp but can't modify blocks
Tip: If you are a ghost you should buy a life: /buy life
Tip: Check these commands: /score /points /look /water /position /alive /lives /items
Tip: When you work together you are more likely to achieve higher score
Tip: Build thick walls to stop lava from getting inside
Tip: Read tips

maps.txt

It is possible to set blocks of any type when lava flood starts, along side executing commands with a delay on stage 1 (building) and 2 (lava flood)

* As Source you can use any Blocks, for example:
ahl, lta, ltb, ltc, ltd, lava_up, ahw
* Attributes x,y,z determines the place where lava block will be placed.
To find appropriate x,y,z values, use /about command in game and
click in the place where you want to lava to start from. Then read coordinates.
* Delay attribute determines how much time in seconds has to pass before
the block/command will be placed/triggered.
* Phase = "1" is time for building a shelter, phase ="2" is time when lava flood started
-->

Example

<Maps>
  <Map name="cube" phase1="0" phase2="0" author="">
    <Source block="ahl" x="39" y="62" z="39" type="" delay="0" />
  </Map>
  <Map name="island" phase1="0" phase2="0" author="">
    <Source block="ahl" x="39" y="63" z="39" type="" delay="0" />
  </Map>
  <Map name="lava_geyser" phase1="0" phase2="0" author="">
    <Source block="ahl" x="0" y="63" z="63" type="" delay="0" />
  </Map>
  <Map name="bouda_metro" phase1="0" phase2="0" author="">
    <Source block="ahl" x="39" y="63" z="39" type="" delay="0" />
    <Source block="ahl" x="2" y="63" z="2" type="" delay="0" />
  </Map>
  <Map name="pluto" phase1="0" phase2="0" author="">
    <Source block="ahl" x="62" y="62" z="1" type="" delay="0" />
    <Command command="say %eOh noes %cMETEOR %eis coming!" delay="60" phase="1" />
    <Command command="place meteor 35 62 33 lava" delay="65" phase="1" />
  </Map>
  <Map name="vulcano" phase1="0" phase2="0" author="">
    <Source block="ahl" x="0" y="63" z="0" type="" delay="0" />
  </Map>
  <Map name="passage" phase1="0" phase2="0" author="">
    <Source block="ahl" x="126" y="63" z="7" type="" delay="0" />
  </Map>
  <Map name="desert_well" phase1="0" phase2="0" author="">
    <Source block="ahl" x="0" y="63" z="63" type="" delay="0" />
  </Map>
</Maps>

Levels

Unfortunetely these are hardcoded, however they allow setting an amount of items to give each round. Better use an algorithm to have similar functionality.

<!--You can add as many tiers as you wish, but minimum number is 10. Also tier 1 always requires 0 experience.-->

<Levels>
  <Level level="1" experience="0" water="2" hammer="0" door="0" sponge="0" />
  <Level level="2" experience="500" water="5" hammer="0" door="0" sponge="0" />
  <Level level="3" experience="1300" water="10" hammer="0" door="0" sponge="0" />
  <Level level="4" experience="2350" water="10" hammer="0" door="0" sponge="1" />
  <Level level="5" experience="3820" water="10" hammer="0" door="0" sponge="2" />
  <Level level="6" experience="5878" water="10" hammer="100" door="4" sponge="2" />
  <Level level="7" experience="8759" water="10" hammer="100" door="4" sponge="2" />
  <Level level="8" experience="11928" water="10" hammer="100" door="4" sponge="3" />
  <Level level="9" experience="15255" water="10" hammer="100" door="4" sponge="3" />
  <Level level="10" experience="18748" water="20" hammer="200" door="6" sponge="3" />
  <Level level="11" experience="22415" water="20" hammer="200" door="6" sponge="3" />
  <Level level="12" experience="26448" water="20" hammer="200" door="6" sponge="3" />
  <Level level="13" experience="30682" water="25" hammer="300" door="6" sponge="4" />
  <Level level="14" experience="35128" water="25" hammer="300" door="8" sponge="4" />
  <Level level="15" experience="39796" water="30" hammer="400" door="8" sponge="4" />
  <Level level="16" experience="44697" water="30" hammer="400" door="8" sponge="4" />
  <Level level="17" experience="49844" water="30" hammer="400" door="10" sponge="4" />
  <Level level="18" experience="55248" water="30" hammer="400" door="10" sponge="5" />
  <Level level="19" experience="60652" water="30" hammer="400" door="10" sponge="5" />
  <Level level="20" experience="66056" water="50" hammer="600" door="12" sponge="6" />
</Levels>

Prices

Item prices in the store, along side their descriptions.

  <Item position="1" id="0" name="life" price="10" amount="1" description=" - gives you one life," />
  <Item position="2" id="1" name="armor" price="30" amount="1" description=" - gives you full protection from lava for 45seconds," />
  <Item position="3" id="2" name="water" price="15" amount="20" description=" - to use write /water and place any block," />
  <Item position="4" id="3" name="sponge" price="20" amount="5" description=" - removes lava around, dissapears quickly," />
  <Item position="5" id="4" name="hammer" price="20" amount="100" description=" - acts like cuboid, write /hammer to use it," />
  <Item position="6" id="5" name="door" price="20" amount="6" description=" - use /door command to create steel doors," />
  <Item position="7" id="8" name="teleport" price="20" amount="1" description=" - use /tp [player] to teleport to the player," />

Lava destruction

It is based on lava's mood. However calm mood doesnm't destroy any blocks.

Code for determening lava mood and block destruction chances

Let chanceCalm be 35
Let chanceDisturbed be 45
Let chanceFurious be 15
Let chanceWild be 5

Let randomNumber be a random number between 0 and 100
If randonNumber < chanceCalm {
  Set lavaState to Calm
}
If randonNumber < chanceCalm + chanceDisturbed {
  Set lavaState to Disturbed
}
//original code is bugged, below pseudo-code has this bug fixed
if randonNumber < chanceCalm + chanceDisturbed + chanceFurious {
  Set lavaState to Furious
}
Else set lavaState to Wild

Lava block destruction:

If lavaState is Calm do nothing

If lavaState is Disturbed { 
  If index is 0 let changeChance be a random number between 0 and 30
  If index is changeChance add block update with type block destruction
  Increment index by 1
  If index > 29 reset index to 0
}

//todo: document glass and obsidian destruction
If lavaState is Furious { 
  If index is 0 let changeChance be a random number between 0 and 20
  If index is changeChance add block update with type block destruction
  Increment index by 1
  If index > 19 reset index to 0
}

If lavaState is Wild { 
  If index is 0 let changeChance be a random number between 0 and 10
  If index is changeChance add block update with type block destruction
  Increment index by 1
  If index > 9 set index to 0
}

Coins

They are rewarded each round if you survive and aren't at spawn, you can double the coins you get by using /ironman or /ironwoman

You can lose 5 coins if you are under sea level

Score

Score is based on air volume and how many lives you have or can be fixed depending on how the server owner has configured scoring, gives you XP.

Code for calculating score

For each player that isn't near spawn {
  If scoring system is based on air {
     Let score be 150 + surroundingBlocks + lives * 20;
     If streak system is enabled {
        Clamp streak to 3
        Set score to score * ((streak / 10) + 1)
     }
  }
  If scoring system is fixed score {
     Let score be fixed score reward
  }
  If scoring system is none {
     Let score be 0
  }
  Add score to player's total score (XP)
  Add 1 to times won
  Save player's data
  Add player to the winner list
  Sort winner list
}

Leveling

Each level requires more than 2x of the previous level

Win streak

Max is 3, and you get a higher score by 10% for each streak.

You can get it by winning rounds, and you lose it by dying.

/time

Shows the status of the game, just like /ls status

/position

Shows if you are above sea level and are a certain distance away from spawn

/hammer

Command like /z but limited based on how much you have bought or obtained at the start of round depending on level.

Sponges

Sponges are finite in lava survival and can absorb lava.

/water

/water is finite in lava survival.

/door

/door is finite in lava survival, and are made out of iron.

/teleport

/teleport is finite in lava survival, and can be used to teleport to other players.

Ghosts

If you run out of lives you become a ghost, but if the server owner configured it you go to a heaven world.

Items

Are given each round and the amount is based on the level you have

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment