- 971
- Posts
- 7
- Years
- Age 21
- Seen Nov 28, 2022
I'm trying to understand coding in general and I think I know all of the symbols, but this one I'm still not exactly sure about. I googled it quickly but couldn't really find much since google doesn't take "||" in account when searching.
What I thought it meant from the bits of code I read I concluded it would be something like "and", "and if" or perhaps "or if". If someone could answer this with certainty, I'd be able to use it and understand what those big "if"'s that include them mean.
I have two small examples here from PokeBattle_MoveEffects:
What I thought it meant from the bits of code I read I concluded it would be something like "and", "and if" or perhaps "or if". If someone could answer this with certainty, I'd be able to use it and understand what those big "if"'s that include them mean.
I have two small examples here from PokeBattle_MoveEffects:
Code:
if attacker.status==0 ||
(attacker.status==PBStatuses::PARALYSIS && !opponent.pbCanParalyze?(attacker,false,self)) ||
(attacker.status==PBStatuses::SLEEP && !opponent.pbCanSleep?(attacker,false,self)) ||
(attacker.status==PBStatuses::POISON && !opponent.pbCanPoison?(attacker,false,self)) ||
(attacker.status==PBStatuses::BURN && !opponent.pbCanBurn?(attacker,false,self)) ||
(attacker.status==PBStatuses::FROZEN && !opponent.pbCanFreeze?(attacker,false,self))
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
Code:
if attacker.gender==2 || opponent.gender==2 || attacker.gender==opponent.gender