Add 'no metal' message when trying to build.
This commit is contained in:
parent
fad9e10a95
commit
36e2dc43b6
3 changed files with 57 additions and 4 deletions
|
@ -1,3 +1,18 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 Marco Cawthorne <marco@icculus.org>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#define TFC_DISPENSER_COST 100
|
#define TFC_DISPENSER_COST 100
|
||||||
|
|
||||||
|
@ -55,8 +70,10 @@ CSEv_TFC_BuildDispenser_(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* it costs */
|
/* it costs */
|
||||||
if (pl.m_iAmmoCells < TFC_DISPENSER_COST)
|
if (pl.m_iAmmoCells < TFC_DISPENSER_COST) {
|
||||||
|
env_message_single(pl, "#Build_nometal");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pl.m_iAmmoCells -= TFC_DISPENSER_COST;
|
pl.m_iAmmoCells -= TFC_DISPENSER_COST;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,18 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 Marco Cawthorne <marco@icculus.org>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#define TFC_SENTRY_COST 130
|
#define TFC_SENTRY_COST 130
|
||||||
|
|
||||||
|
@ -65,8 +80,10 @@ CSEv_TFC_BuildSentry_(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* it costs */
|
/* it costs */
|
||||||
if (pl.m_iAmmoCells < TFC_SENTRY_COST)
|
if (pl.m_iAmmoCells < TFC_SENTRY_COST) {
|
||||||
|
env_message_single(pl, "#Build_nometal");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pl.m_iAmmoCells -= TFC_SENTRY_COST;
|
pl.m_iAmmoCells -= TFC_SENTRY_COST;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,18 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 Marco Cawthorne <marco@icculus.org>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
#define TFC_TELEPORTER_COST 125
|
#define TFC_TELEPORTER_COST 125
|
||||||
|
|
||||||
|
@ -121,8 +136,10 @@ CSEv_TFC_BuildTele_(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* it costs */
|
/* it costs */
|
||||||
if (pl.m_iAmmoCells < TFC_TELEPORTER_COST)
|
if (pl.m_iAmmoCells < TFC_TELEPORTER_COST) {
|
||||||
|
env_message_single(pl, "#Build_nometal");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pl.m_iAmmoCells -= TFC_TELEPORTER_COST;
|
pl.m_iAmmoCells -= TFC_TELEPORTER_COST;
|
||||||
|
|
||||||
|
@ -142,8 +159,10 @@ CSEv_TFC_BuildTeleExit_(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* it costs */
|
/* it costs */
|
||||||
if (pl.m_iAmmoCells < TFC_TELEPORTER_COST)
|
if (pl.m_iAmmoCells < TFC_TELEPORTER_COST) {
|
||||||
|
env_message_single(pl, "#Build_nometal");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pl.m_iAmmoCells -= TFC_TELEPORTER_COST;
|
pl.m_iAmmoCells -= TFC_TELEPORTER_COST;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue