2359 {
2360 super.OnAction(action_id, player, ctx);
2361
2363 {
2364 switch (action_id)
2365 {
2369 return true;
2373 return true;
2374 }
2375 }
2376
2378 {
2379 switch (action_id)
2380 {
2382 Delete();
2383 return true;
2384 }
2385 }
2386
2387 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
2388 {
2389 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
2390 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
2392 if (
EActions.RECIPES_RANGE_START < 1000)
2393 {
2394 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
2395 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
2396 }
2397 }
2398 #ifndef SERVER
2399 else if (action_id ==
EActions.WATCH_PLAYER)
2400 {
2401 PluginDeveloper.SetDeveloperItemClientEx(player);
2402 }
2403 #endif
2405 {
2406 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
2407 {
2408 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
2409 OnDebugButtonPressServer(id + 1);
2410 }
2411
2412 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
2413 {
2414 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
2416 }
2417
2418 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
2419 {
2420 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
2422 }
2423
2424 else if (action_id ==
EActions.ADD_QUANTITY)
2425 {
2426 if (IsMagazine())
2427 {
2428 Magazine mag = Magazine.Cast(this);
2429 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
2430 }
2431 else
2432 {
2434 }
2435
2436 if (m_EM)
2437 {
2438 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
2439 }
2440
2441 }
2442
2443 else if (action_id ==
EActions.REMOVE_QUANTITY)
2444 {
2445 if (IsMagazine())
2446 {
2447 Magazine mag2 = Magazine.Cast(this);
2448 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
2449 }
2450 else
2451 {
2453 }
2454 if (m_EM)
2455 {
2456 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
2457 }
2458
2459 }
2460
2461 else if (action_id ==
EActions.SET_QUANTITY_0)
2462 {
2464
2465 if (m_EM)
2466 {
2467 m_EM.SetEnergy(0);
2468 }
2469 }
2470
2471 else if (action_id ==
EActions.SET_MAX_QUANTITY)
2472 {
2474
2475 if (m_EM)
2476 {
2477 m_EM.SetEnergy(m_EM.GetEnergyMax());
2478 }
2479 }
2480
2481 else if (action_id ==
EActions.ADD_HEALTH)
2482 {
2483 AddHealth("","",GetMaxHealth("","Health")/5);
2484 }
2485 else if (action_id ==
EActions.REMOVE_HEALTH)
2486 {
2487 AddHealth("","",-GetMaxHealth("","Health")/5);
2488 }
2489 else if (action_id ==
EActions.DESTROY_HEALTH)
2490 {
2491 SetHealth01("","",0);
2492 }
2493 else if (action_id ==
EActions.WATCH_ITEM)
2494 {
2497 #ifdef DEVELOPER
2498 SetDebugDeveloper_item(this);
2499 #endif
2500 }
2501
2502 else if (action_id ==
EActions.ADD_TEMPERATURE)
2503 {
2504 AddTemperature(20);
2505
2506 }
2507
2508 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
2509 {
2510 AddTemperature(-20);
2511
2512 }
2513
2514 else if (action_id ==
EActions.FLIP_FROZEN)
2515 {
2516 SetFrozen(!GetIsFrozen());
2517
2518 }
2519
2520 else if (action_id ==
EActions.ADD_WETNESS)
2521 {
2523
2524 }
2525
2526 else if (action_id ==
EActions.REMOVE_WETNESS)
2527 {
2529
2530 }
2531
2532 else if (action_id ==
EActions.LIQUIDTYPE_UP)
2533 {
2536
2537
2538 }
2539
2540 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
2541 {
2544 }
2545
2546 else if (action_id ==
EActions.MAKE_SPECIAL)
2547 {
2548 auto debugParams = DebugSpawnParams.WithPlayer(player);
2549 OnDebugSpawnEx(debugParams);
2550 }
2551
2552 }
2553
2554
2555 return false;
2556 }
override void SetQuantity()
proto GizmoApi GetGizmoApi()
override void InsertAgent(int agent, float count=1)
override float GetWetMax()
override void RemoveAgent(int agent_id)
override int GetLiquidType()
override void AddWet(float value)
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 SetLiquidType(int value, bool allow_client=false)
override int GetQuantityMax()
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
proto void SelectObject(Object object)
proto void SelectPhysics(Physics physics)