# List of Game Rules

Game rules can be setup and acquired directly by rule name, one thing to note is that: Most game rules need to be setup before game start, that is before Game.Start event, othervise it will not take effect The specific use cases are as follows:

local GameRule = class.GameRule.new()
function InitGameRule()
	GameRule.EndTime = 6  		 --Game time
	GameRule.TeamNum = 2         --Number of teams
	GameRule.MaxPlayers = 6      --Maximum number of players
	GameRule.StartMode = 0       --Start mode 0:start by host
	GameRule.StartPlayers = 1    --Minimum number of players: 2 players
	GameRule.PlayerDieDrops = 1  --Drop item when die 1:true
	GameRule.DisplayScore = 1    --Display score 1:true
	GameRule.AllowMidwayJoin = 1 --Allow to join mid-term 1:allow
	GameRule.ScoreKillPlayer = 1 --Kill player to get 1 score
	GameRule.BlockDestroy = 1    --Block is breakable 1:true
	GameRule.WinLoseEndTime = 1  --If game overtime and end, player wins
	if GameRule.CameraDir ~= 1 then
		GameRule.CameraDir = 1 --Setup default front view
No. Rule Name Description
1 GameRule.CurTime Acquire/setup current time
2 GameRule.TimeLocked Time lock/Time lockdown
3 GameRule.Weather Weather 0Sunny 1Rainy
4 GameRule.MaxPlayers Maximum number of players
5 GameRule.BlockDestroy If block is breakable 0:No 1:Yes
6 GameRule.BlockPlace If block is placeable 0:No 1:Yes
7 GameRule.BlockUse If block is usable 0:No 1:Yes
8 GameRule.GravityFactor Gravity(value range 0.1~10)
9 GameRule.CameraDir View Direction 0/1/2:Default First Person View/Front View/3rd-Person View, 3/4/5/6:Lockdown First Person View/Front View/3rd-Person View/Top Down View
10 GameRule.StartMode Start mode:0host/1Auto
11 GameRule.StartPlayers Number of players to start game
12 GameRule.TeamNum Number of teams
13 GameRule.AttackPlayerMode Ban attack: 1Player/2Teammate
14 GameRule.EndTime Game time setup
15 GameRule.EndScore Victory score setup
16 GameRule.ScoreKillPlayer Score points for killing players
17 GameRule.ScoreKillMob Score points for killing monsters
18 GameRule.ScoreCollectStar Score points for collecting stars(Shiny Star)
19 GameRule.ReviveMode Respawn mode setup:in seconds. 0 is custom, click to respawn
20 GameRule.ReviveInvulnerable Respawn with invincible buff:in seconds. 0 is default time(5 seconds)
21 GameRule.DisplayName Name display 0default display 1Own team 2Opponent 3No display
22 GameRule.WinLoseEndTime Overtime Victory 0Based on score 1Victory(Green) 2Lose(Red)
23 GameRule.SaveMode Save mode 1:do not save 0:save running
24 GameRule.KillNotify Notice of player killed 1:true 0:false (show in game chat)
25 GameRule.BgMusicMode Background music 0:off 1-8:corresponds to different music
26 GameRule.MobGen Mob Generator: -1:Based on block setup, 0:No, 1:Yes
27 GameRule.SpawnPtMode Select respawn point 0:random 1:closest
28 GameRule.MinimapTeams Mini-map display : 0:Display to all 1:No display to other team
29 GameRule.PlayerDieDrops If player drop items when die 0:Drop to where die 3:Drop to storage box other:no drop
30 GameRule.DisplayScore Display score and time 1:true 0:false
31 GameRule.LifeNum Game life, game lose when number of die match setup game life
32 GameRule.ShowSight Display aim point: 1Display 2Hide
33 GameRule.ScoreColorChange Color-changing scoring:Custom score, score of each color change
34 GameRule.GPoisonSwitch Whole Game Toxic Circle 1-On 0-Off
35 GameRule.GPoisonSafeD0 The diameter of the first safety zone
36 GameRule.GPoisonSafeT0 The time of the first safety zone
37 GameRule.AllowMidwayJoin Allow to join mid-term 0:Not allowed 1:Allowed
38 GameRule.LifeNumTeamShare Team life share 0:No share 1:Share
39 GameRule.ViewMode Enable view game after defeated 0:disable 1:enable
40 GameRule.ViewType View game type: 0-Free 1-Follow screen 2-Switchable
41 GameRule.CountDown Countdown time
42 GameRule.ScoreResetRound Score and round reset:Similar to football (restart after scoring) 1:true
43 GameRule.ResetScore Required score to reset round. Reach certain score then round will be reset
Last Update: 11/1/2019, 6:30:06 PM