2424 {
2425 super.OnAction(action_id, player, ctx);
2426
2428 {
2429 switch (action_id)
2430 {
2434 return true;
2438 return true;
2439 }
2440 }
2441
2443 {
2444 switch (action_id)
2445 {
2447 Delete();
2448 return true;
2449 }
2450 }
2451
2452 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
2453 {
2454 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
2455 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
2456 PlayerBase p = PlayerBase.Cast(player);
2457 if (
EActions.RECIPES_RANGE_START < 1000)
2458 {
2459 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
2460 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
2461 }
2462 }
2463 #ifndef SERVER
2464 else if (action_id ==
EActions.WATCH_PLAYER)
2465 {
2466 PluginDeveloper.SetDeveloperItemClientEx(player);
2467 }
2468 #endif
2470 {
2471 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
2472 {
2473 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
2474 OnDebugButtonPressServer(id + 1);
2475 }
2476
2477 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
2478 {
2479 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
2481 }
2482
2483 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
2484 {
2485 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
2487 }
2488
2489 else if (action_id ==
EActions.ADD_QUANTITY)
2490 {
2491 if (IsMagazine())
2492 {
2493 Magazine mag = Magazine.Cast(this);
2494 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
2495 }
2496 else
2497 {
2499 }
2500
2501 if (m_EM)
2502 {
2503 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
2504 }
2505
2506 }
2507
2508 else if (action_id ==
EActions.REMOVE_QUANTITY)
2509 {
2510 if (IsMagazine())
2511 {
2512 Magazine mag2 = Magazine.Cast(this);
2513 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
2514 }
2515 else
2516 {
2518 }
2519 if (m_EM)
2520 {
2521 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
2522 }
2523
2524 }
2525
2526 else if (action_id ==
EActions.SET_QUANTITY_0)
2527 {
2529
2530 if (m_EM)
2531 {
2532 m_EM.SetEnergy(0);
2533 }
2534 }
2535
2536 else if (action_id ==
EActions.SET_MAX_QUANTITY)
2537 {
2539
2540 if (m_EM)
2541 {
2542 m_EM.SetEnergy(m_EM.GetEnergyMax());
2543 }
2544 }
2545
2546 else if (action_id ==
EActions.ADD_HEALTH)
2547 {
2548 AddHealth("","",GetMaxHealth("","Health")/5);
2549 }
2550 else if (action_id ==
EActions.REMOVE_HEALTH)
2551 {
2552 AddHealth("","",-GetMaxHealth("","Health")/5);
2553 }
2554 else if (action_id ==
EActions.DESTROY_HEALTH)
2555 {
2556 SetHealth01("","",0);
2557 }
2558 else if (action_id ==
EActions.WATCH_ITEM)
2559 {
2561 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
2562 #ifdef DEVELOPER
2563 SetDebugDeveloper_item(this);
2564 #endif
2565 }
2566
2567 else if (action_id ==
EActions.ADD_TEMPERATURE)
2568 {
2569 AddTemperature(20);
2570
2571 }
2572
2573 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
2574 {
2575 AddTemperature(-20);
2576
2577 }
2578
2579 else if (action_id ==
EActions.FLIP_FROZEN)
2580 {
2581 SetFrozen(!GetIsFrozen());
2582
2583 }
2584
2585 else if (action_id ==
EActions.ADD_WETNESS)
2586 {
2588
2589 }
2590
2591 else if (action_id ==
EActions.REMOVE_WETNESS)
2592 {
2594
2595 }
2596
2597 else if (action_id ==
EActions.LIQUIDTYPE_UP)
2598 {
2601
2602
2603 }
2604
2605 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
2606 {
2609 }
2610
2611 else if (action_id ==
EActions.MAKE_SPECIAL)
2612 {
2613 auto debugParams = DebugSpawnParams.WithPlayer(player);
2614 OnDebugSpawnEx(debugParams);
2615 }
2616
2617 }
2618
2619
2620 return false;
2621 }
proto GizmoApi GetGizmoApi()
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
proto void SelectObject(Object object)
proto void SelectPhysics(Physics physics)
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)