2398 {
2399 super.OnAction(action_id, player, ctx);
2400
2402 {
2403 switch (action_id)
2404 {
2407 return true;
2410 return true;
2411 }
2412 }
2413
2415 {
2416 switch (action_id)
2417 {
2419 Delete();
2420 return true;
2421 }
2422 }
2423
2424 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
2425 {
2426 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
2427 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
2428 PlayerBase p = PlayerBase.Cast(player);
2429 if (
EActions.RECIPES_RANGE_START < 1000)
2430 {
2431 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
2432 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
2433 }
2434 }
2435 #ifndef SERVER
2436 else if (action_id ==
EActions.WATCH_PLAYER)
2437 {
2438 PluginDeveloper.SetDeveloperItemClientEx(player);
2439 }
2440 #endif
2442 {
2443 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
2444 {
2445 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
2446 OnDebugButtonPressServer(id + 1);
2447 }
2448
2449 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
2450 {
2451 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
2453 }
2454
2455 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
2456 {
2457 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
2459 }
2460
2461 else if (action_id ==
EActions.ADD_QUANTITY)
2462 {
2463 if (IsMagazine())
2464 {
2465 Magazine mag = Magazine.Cast(this);
2466 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
2467 }
2468 else
2469 {
2471 }
2472
2473 if (m_EM)
2474 {
2475 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
2476 }
2477
2478 }
2479
2480 else if (action_id ==
EActions.REMOVE_QUANTITY)
2481 {
2482 if (IsMagazine())
2483 {
2484 Magazine mag2 = Magazine.Cast(this);
2485 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
2486 }
2487 else
2488 {
2490 }
2491 if (m_EM)
2492 {
2493 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
2494 }
2495
2496 }
2497
2498 else if (action_id ==
EActions.SET_QUANTITY_0)
2499 {
2501
2502 if (m_EM)
2503 {
2504 m_EM.SetEnergy(0);
2505 }
2506 }
2507
2508 else if (action_id ==
EActions.SET_MAX_QUANTITY)
2509 {
2511
2512 if (m_EM)
2513 {
2514 m_EM.SetEnergy(m_EM.GetEnergyMax());
2515 }
2516 }
2517
2518 else if (action_id ==
EActions.ADD_HEALTH)
2519 {
2520 AddHealth("","",GetMaxHealth("","Health")/5);
2521 }
2522 else if (action_id ==
EActions.REMOVE_HEALTH)
2523 {
2524 AddHealth("","",-GetMaxHealth("","Health")/5);
2525 }
2526 else if (action_id ==
EActions.DESTROY_HEALTH)
2527 {
2528 SetHealth01("","",0);
2529 }
2530 else if (action_id ==
EActions.WATCH_ITEM)
2531 {
2533 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
2534 #ifdef DEVELOPER
2535 SetDebugDeveloper_item(this);
2536 #endif
2537 }
2538
2539 else if (action_id ==
EActions.ADD_TEMPERATURE)
2540 {
2541 AddTemperature(20);
2542
2543 }
2544
2545 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
2546 {
2547 AddTemperature(-20);
2548
2549 }
2550
2551 else if (action_id ==
EActions.FLIP_FROZEN)
2552 {
2553 SetFrozen(!GetIsFrozen());
2554
2555 }
2556
2557 else if (action_id ==
EActions.ADD_WETNESS)
2558 {
2560
2561 }
2562
2563 else if (action_id ==
EActions.REMOVE_WETNESS)
2564 {
2566
2567 }
2568
2569 else if (action_id ==
EActions.LIQUIDTYPE_UP)
2570 {
2573
2574
2575 }
2576
2577 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
2578 {
2581 }
2582
2583 else if (action_id ==
EActions.MAKE_SPECIAL)
2584 {
2585 auto debugParams = DebugSpawnParams.WithPlayer(player);
2586 OnDebugSpawnEx(debugParams);
2587 }
2588
2589 }
2590
2591
2592 return false;
2593 }
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
proto native void GizmoSelectObject(Object object)
proto native void GizmoSelectPhysics(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)
proto native CGame GetGame()