Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed|libheretic: Cheats not working in multiplayer
See: b9fdf4f Todo: The cheats 'gimme', 'iddqd' and 'idkfa' require various new features and/or functionality. I'll return to these once libhexen has been updated...
- Loading branch information
1 parent
bc0d024
commit f5e4677
Showing
9 changed files
with
801 additions
and
798 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,133 @@ | ||
/**\file | ||
*\section License | ||
* License: GPL | ||
* Online License Link: http://www.gnu.org/licenses/gpl.html | ||
/** @file p_inter.h | ||
* | ||
*\author Copyright © 2009-2013 Daniel Swanson <danij@dengine.net> | ||
* @authors Copyright © 2009-2013 Daniel Swanson <danij@dengine.net> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* @par License | ||
* GPL: http://www.gnu.org/licenses/gpl.html | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* <small>This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. This program is distributed in the hope that it | ||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. You should have received a copy of the GNU | ||
* General Public License along with this program; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA</small> | ||
*/ | ||
|
||
#ifndef LIBHERETIC_P_INTER_H | ||
#define LIBHERETIC_P_INTER_H | ||
|
||
#ifndef __JHERETIC__ | ||
# error "Using jHeretic headers without __JHERETIC__" | ||
#endif | ||
|
||
#include "doomdef.h" | ||
#include "p_player.h" | ||
|
||
DENG_EXTERN_C int maxAmmo[NUM_AMMO_TYPES]; | ||
DENG_EXTERN_C int clipAmmo[NUM_AMMO_TYPES]; | ||
|
||
/** | ||
* @return @c true if power accepted. | ||
*/ | ||
boolean P_GivePower(player_t *player, powertype_t powerType); | ||
|
||
/** | ||
* @param player Player to relieve of the power. | ||
* @param powerType Power type to take. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, | ||
* Boston, MA 02110-1301 USA | ||
* @return @c true iff the power was taken. | ||
*/ | ||
boolean P_TakePower(player_t *player, powertype_t powerType); | ||
|
||
/** | ||
* p_inter.h: Handling interactions (i.e., collisions). | ||
* @param player Player to toggle a power for. | ||
* @param powerType Power type to toggle. | ||
* | ||
* @return @c true iff the power was toggled. | ||
*/ | ||
boolean P_TogglePower(player_t *player, powertype_t powerType); | ||
|
||
#ifndef __P_INTER_H__ | ||
#define __P_INTER_H__ | ||
/** | ||
* Give key(s) to the specified player. If a key is successfully given a short | ||
* "bonus flash" screen tint animation is played and a HUE_ON_PICKUP_KEY event | ||
* is generated (which optionally reveals the HUD if hidden). If the specified | ||
* key(s) are already owned then nothing will happen (and false is returned). | ||
* | ||
* @param player Player to receive the key(s). | ||
* @param keyType Key type to give. Use @c NUM_KEY_TYPES to give ALL keys. | ||
* | ||
* @return @c true iff at least one new key was given (not already owned). | ||
*/ | ||
boolean P_GiveKey(player_t *player, keytype_t keyType); | ||
|
||
#ifndef __JHERETIC__ | ||
# error "Using jHeretic headers without __JHERETIC__" | ||
#endif | ||
/** | ||
* Give ammo(s) to the specified player. If a ammo is successfully given the | ||
* player 'brain' may decide to change weapon (depends on the user's config) | ||
* and a HUE_ON_PICKUP_AMMO event is generated (which optionally reveals the | ||
* HUD if hidden). If the specified ammo(s) are already owned then nothing will | ||
* happen (and false is returned). | ||
* | ||
* @note The final number of rounds the player will receive depends on both the | ||
* ammount given and how many the player can carry. Use @ref P_GiveBackpack() | ||
* to equip the player with a backpack, thereby increasing this capacity. | ||
* | ||
* @param player Player to receive the ammo(s). | ||
* @param ammoType Ammo type to give. Use @c NUM_AMMO_TYPES to give ALL ammos. | ||
* Giving the special 'unlimited ammo' type @c AT_NOAMMO will | ||
* always succeed, however no sideeffects will occur. | ||
* @param numRounds Number of rounds to give. Use @c -1 to give as many rounds | ||
* as necessary to fully replenish stock. | ||
* | ||
* @return @c true iff at least one new round was given (not already owned). | ||
*/ | ||
boolean P_GiveAmmo(player_t *player, ammotype_t ammoType, int numRounds); | ||
|
||
boolean P_GiveArmor(player_t* plr, int type, int points); | ||
/** | ||
* @param player Player to receive the health. | ||
* @param amount Amount of health to give. Use @c -1 to fully replenish. | ||
* | ||
* @return @c true iff at least some of the health was given. | ||
*/ | ||
boolean P_GiveHealth(player_t *player, int amount); | ||
|
||
#endif | ||
/** | ||
* @param player Player to receive the backpack. | ||
*/ | ||
void P_GiveBackpack(player_t *player); | ||
|
||
/** | ||
* @return @c true if the weapon or its ammo was accepted. | ||
*/ | ||
boolean P_GiveWeapon(player_t *player, weapontype_t weaponType); | ||
|
||
/** | ||
* @return @c true iff the armor was given. | ||
*/ | ||
boolean P_GiveArmor(player_t *player, int armorType, int armorPoints); | ||
|
||
void P_TouchSpecialMobj(mobj_t *special, mobj_t *toucher); | ||
|
||
/** | ||
* @return @c true, if the player is morphed. | ||
*/ | ||
boolean P_MorphPlayer(player_t *player); | ||
|
||
/** | ||
* Damages both enemies and players. | ||
* | ||
* @param inflictor Mobj that caused the damage creature or missile, | ||
* can be NULL (slime, etc) | ||
* @param source Mobj to target after taking damage. Can be @c NULL | ||
* for barrel explosions and other environmental stuff. | ||
* Source and inflictor are the same for melee attacks. | ||
* | ||
* @return Actual amount of damage done. | ||
*/ | ||
int P_DamageMobj2(mobj_t *target, mobj_t *inflictor, mobj_t *source, int damageP, boolean stomping, boolean skipNetworkCheck); | ||
int P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, int damageP, boolean stomping/*, boolean skipNetworkCheck = false*/); | ||
|
||
#endif // LIBHERETIC_P_INTER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.