2347 {
2348 super.OnAction(action_id, player, ctx);
2349 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
2350 {
2351 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
2352 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
2353 PlayerBase p = PlayerBase.Cast(player);
2354 if (
EActions.RECIPES_RANGE_START < 1000)
2355 {
2356 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
2357 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
2358 }
2359 }
2360 #ifndef SERVER
2361 else if (action_id ==
EActions.WATCH_PLAYER)
2362 {
2363 PluginDeveloper.SetDeveloperItemClientEx(player);
2364 }
2365 #endif
2367 {
2368 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
2369 {
2370 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
2371 OnDebugButtonPressServer(id + 1);
2372 }
2373
2374 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
2375 {
2376 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
2378 }
2379
2380 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
2381 {
2382 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
2384 }
2385
2386 else if (action_id ==
EActions.ADD_QUANTITY)
2387 {
2388 if (IsMagazine())
2389 {
2390 Magazine mag = Magazine.Cast(this);
2391 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
2392 }
2393 else
2394 {
2396 }
2397
2398 if (m_EM)
2399 {
2400 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
2401 }
2402
2403 }
2404
2405 else if (action_id ==
EActions.REMOVE_QUANTITY)
2406 {
2407 if (IsMagazine())
2408 {
2409 Magazine mag2 = Magazine.Cast(this);
2410 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
2411 }
2412 else
2413 {
2415 }
2416 if (m_EM)
2417 {
2418 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
2419 }
2420
2421 }
2422
2423 else if (action_id ==
EActions.SET_QUANTITY_0)
2424 {
2426
2427 if (m_EM)
2428 {
2429 m_EM.SetEnergy(0);
2430 }
2431 }
2432
2433 else if (action_id ==
EActions.SET_MAX_QUANTITY)
2434 {
2436
2437 if (m_EM)
2438 {
2439 m_EM.SetEnergy(m_EM.GetEnergyMax());
2440 }
2441 }
2442
2443 else if (action_id ==
EActions.ADD_HEALTH)
2444 {
2445 AddHealth("","",GetMaxHealth("","Health")/5);
2446 }
2447 else if (action_id ==
EActions.REMOVE_HEALTH)
2448 {
2449 AddHealth("","",-GetMaxHealth("","Health")/5);
2450 }
2451 else if (action_id ==
EActions.DESTROY_HEALTH)
2452 {
2453 SetHealth01("","",0);
2454 }
2455 else if (action_id ==
EActions.WATCH_ITEM)
2456 {
2458 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
2459 #ifdef DEVELOPER
2460 SetDebugDeveloper_item(this);
2461 #endif
2462 }
2463
2464 else if (action_id ==
EActions.ADD_TEMPERATURE)
2465 {
2466 AddTemperature(20);
2467
2468 }
2469
2470 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
2471 {
2472 AddTemperature(-20);
2473
2474 }
2475
2476 else if (action_id ==
EActions.FLIP_FROZEN)
2477 {
2478 SetFrozen(!GetIsFrozen());
2479
2480 }
2481
2482 else if (action_id ==
EActions.ADD_WETNESS)
2483 {
2485
2486 }
2487
2488 else if (action_id ==
EActions.REMOVE_WETNESS)
2489 {
2491
2492 }
2493
2494 else if (action_id ==
EActions.LIQUIDTYPE_UP)
2495 {
2498
2499
2500 }
2501
2502 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
2503 {
2506 }
2507
2508 else if (action_id ==
EActions.MAKE_SPECIAL)
2509 {
2510 auto debugParams = DebugSpawnParams.WithPlayer(player);
2511 OnDebugSpawnEx(debugParams);
2512 }
2513
2514 else if (action_id ==
EActions.DELETE)
2515 {
2516 Delete();
2517 }
2518
2519 }
2520
2521
2522 return false;
2523 }
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override void InsertAgent(int agent, float count=1)
override int GetQuantityMax()
override int GetLiquidType()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Set item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override void SetLiquidType(int value, bool allow_client=false)
override void RemoveAgent(int agent_id)
override float GetWetMax()
override void AddWet(float value)
proto native CGame GetGame()