recreation of symtom claass and symbtom_list
This commit is contained in:
		
							
								
								
									
										18
									
								
								lua/autorun/server/sv_symbtom.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								lua/autorun/server/sv_symbtom.lua
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,18 @@ | |||||||
|  | Symbtom = {}  | ||||||
|  |  | ||||||
|  | --- Disease class | ||||||
|  | ---@param side name string? the name of the symbtom (string) | ||||||
|  | ---@param side func function? the function called when symbtom | ||||||
|  | ---@param side delay number? delay time between two symbtoms | ||||||
|  | ---@param side level float? the level of the symbtom (between 0-1) | ||||||
|  | function Symbtom:new(name, func, level, delay) | ||||||
|  |     local instance = {} | ||||||
|  |     setmetatable(instance, {__index = Disease}) | ||||||
|  |     instance.name = name | ||||||
|  |     instance.func = func | ||||||
|  |     instance.level = level | ||||||
|  |     instance.delay = delay | ||||||
|  |     return instance | ||||||
|  | end | ||||||
|  |  | ||||||
|  | return Symbtom | ||||||
| @ -1 +0,0 @@ | |||||||
| Symbtoms_list = {} |  | ||||||
| @ -1,10 +1,11 @@ | |||||||
| include("autorun/server/sv_symbtoms.lua") | symbtoms_list = include("sv_symbtoms.lua") | ||||||
|  |  | ||||||
| table.insert(Symbtoms_list, "cough" = cough_func) | table.insert(symbtoms_list, "cough" = cough) | ||||||
|  |  | ||||||
| --- Send a packet to trigger cough animation to the player | --- Send a packet to trigger cough animation to the player | ||||||
| ---@param side UID64 string? UID64 of the player | ---@param side UID64 string? UID64 of the player | ||||||
|  | ---@param side level float? A float between 0 and 1 | ||||||
| ---@return void | ---@return void | ||||||
| function cough(UID64) | function cough(UID64, level) | ||||||
|  |  | ||||||
| end | end | ||||||
							
								
								
									
										3
									
								
								lua/autorun/server/symptoms/sv_symbtoms.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								lua/autorun/server/symptoms/sv_symbtoms.lua
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | |||||||
|  | symbtoms_list = {} | ||||||
|  |  | ||||||
|  | return symbtoms_list | ||||||
							
								
								
									
										11
									
								
								lua/autorun/server/symptoms/sv_vomit.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								lua/autorun/server/symptoms/sv_vomit.lua
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,11 @@ | |||||||
|  | symbtoms_list = include("sv_symbtoms.lua") | ||||||
|  |  | ||||||
|  | table.insert(symbtoms_list, "vomit" = vomit) | ||||||
|  |  | ||||||
|  | --- Send a packet to trigger cough animation to the player | ||||||
|  | ---@param side UID64 string? UID64 of the player | ||||||
|  | ---@param side level float? A float between 0 and 1 | ||||||
|  | ---@return void | ||||||
|  | function vomit(UID64, level) | ||||||
|  |  | ||||||
|  | end | ||||||
		Reference in New Issue
	
	Block a user